41 lines
487 B
NASM
41 lines
487 B
NASM
extern puts
|
|
extern printf
|
|
default rel
|
|
%include "../length_func.inc"
|
|
|
|
|
|
|
|
|
|
section .rodata
|
|
format db "%#x", 10, 0
|
|
|
|
section .data
|
|
text db "rEE",0
|
|
testasd dq 0
|
|
section .text
|
|
global main
|
|
|
|
main:
|
|
sub rsp, 8 ;enter
|
|
|
|
|
|
|
|
mov r8, text
|
|
call length_func
|
|
mov [testasd], rax
|
|
|
|
mov rdi, text
|
|
cld
|
|
call puts ;this is the puts way of printing a string
|
|
|
|
|
|
mov rsi, [testasd]
|
|
lea rdi, [rel format]
|
|
xor eax, eax ; AL=0 no FP args in XMM regs
|
|
call printf
|
|
|
|
|
|
|
|
_end:
|
|
add rsp, 8 ;exit
|
|
ret
|