I am currently new to and learning assembly language (primarily with NASM)
In one of the tutorials that I was following, the instructor did
;Input codes, entry points, etc.
_showAge:
mov rax, 1
mov rdi, 1
mov rsi, ageTxt
mov rdx, 13
syscall ;"Your age is: "
mov rax, 1
mov rdi, 1
mov rsi, age
mov rdx, 3
syscall
ret
And it works as intended. But when I attempted to shortened the code myself...
_showAge:
mov rax, 1
mov rdi, 1
mov rsi, ageTxt
mov rdx, 13
syscall ;"Your age is: "
mov rsi, age
mov rdx, 3
syscall ; Doesn't do anything
ret
This does not do anything anymore,
My question is what is the reasoning behind why can't we do the following code as shown above?
(This script was tested and ran in Linux x86_64, Ubuntu)