1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
section .data
msg: db "hello ",0
enter: db "enter name",10,0
section .bss
name: resb 20
section .text
global _start
_start:
mov rax,enter
call _printFunc
call _enterName
mov rax,msg
call _printFunc
mov rax,name
call _printFunc
mov rax,60
mov rdi,0
syscall
_printFunc:
push rax
mov rbx,0
_printloop:
inc rax
inc rbx
mov cl,[rax]
cmp cl,0
jne _printloop
mov rax,1
mov rdi,1
pop rsi
mov rdx,rbx
syscall
ret
_enterName:
mov rax,0
mov rdi,0
mov rsi,name
mov rdx,20
syscall
ret
|