I am learning ASM and I have a little problem. I cannot "declare" more than one line in "section.data". I am trying something like this:
section .data
string1 db "test1 ", 0;
string2 db "test2 ", 0;
section .text
global _test
extern _puts
_test:
lea rdi, [rel string1]
call _puts
lea rdi, [rel string2]
call _puts
ret
This function should print "test1 test2" in STDOUT, but it does not work. Result:
test2
It only works for the last saved line! If anyone knows why, please tell me!
source
share