I just starting to learn assembly and I am curious as to whether I can use any register to store anything or if only certain registers can store certain data.
Any help would be awesome, thanks everyone!
EDIT:
After doing some poking around, am I right in saying that I have to use certain register for certain tasks?
For instance, i found this code snippet:
org 100h ; dos will load us at offset 100h (256) into some segment
section .text
mov ah, 9
mov dx, msg
int 21h
ret
section .data
msg db "hello world!$"
here:
http://forum.nasm.us/index.php?topic=832.msg2691#msg2691When I compiled it as a .COM file using the -f bin flag it ran just fine. However when I modified the code like this:
org 100h ; dos will load us at offset 100h (256) into some segment
section .text
mov ax, 9
mov dx, msg
int 21h
ret
section .data
msg db "hello world!$"
and recompiled it using the -f bin flag it no longer works. Can someone possibly explain to me why the first code snippet works and the second one does not?