zombie-core-utils/length.asm

42 lines
522 B
NASM

extern puts
extern printf
default rel
%include "../length_func.inc"
section .rodata
format db "%#x", 10, 0
section .data
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
section .text
global main
main:
sub rsp, 8 ;enter
mov r8, text
call length_func
mov rdi, text
cld
call puts ;this is the puts way of printing a string
mov rsi, r8
lea rdi, [rel format]
xor eax, eax ; AL=0 no FP args in XMM regs
call printf
_end:
add rsp, 8 ;exit
ret