I am doing assembly programming and trying to accept a number from the user in a variabel num1 but some garbage is getting printed on the terminal. The image of the output is given in the desciption. Explain Why ?
%macro print 2
mov rax,1
mov rdi,1
mov rsi,%1
mov rdx,%2
syscall
%endmacro
%macro accept 2
mov rax,0
mov rdi,0
mov rsi,%1
mov rdx,%2
syscall
%endmacro
%macro exit 0
mov rax,60
mov rdi,0
syscall
%endmacro
section .bss
num1 resb 5 ;1 extra for enter key
choice resb 2
tempbuff resb 8
section .data
enter1 dq 10,"num1 : ",
len1 equ $-enter1
newline db 0AH
section .code
global _start
_start:
print enter1,len1
accept num1,5
exit