Assembly language is quite straight forward but I am confused on how to use registers for example:
section .data
msg db "Hello, world!",0xa
len equ $ - msg
section .text
global _start
_start:
;write our string to stdout
mov edx,len
mov ecx,msg
mov eax,4
int 0x80
;and exit
mov ebx,0
mov eax,1
int 0x80
Its working fine but when i change the code to:
section .data
msg db "Hello, world!",0xa
len equ $ - msg
section .text
global _start
_start:
;write our string to stdout
mov ebx,len
mov edx,msg
mov eax,4
int 0x80
;and exit
mov ebx,0
mov eax,1
int 0x80
It will compile but it will not display 'Hello, World'
. All I did was change the register for len
and msg
. Is there a convention on what register must contain?