Trying to write msg1 and msg2 sequentially on stdout to get something like this:
Hello
World
But instead prints this :
Hello
World
World
section .data
msg1 db 'Hello',10,0
msg2 db 'World',10,0
len1 equ $- msg1
len2 equ $- msg2
section .text
global CMAIN
CMAIN:
mov ebp, esp; for correct debugging
mov edx,len1
mov ecx,msg1
call printString
mov edx, len2
mov ecx, msg2
call printString
mov eax,1
int 0x80
printString:
mov ebx,1
mov eax,4
int 0x80
xor eax, eax
ret
Please could somebody explain me why this happens?