Page 1 of 1

where to place ah or al ?

Posted: Wed Dec 03, 2008 5:52 pm
by popey
hello

i have a small confusion.....when we write mov ah,0x0e why do we move 0x0e to ah not to al...similarly for many other mov instructions do i always need to remember such things or there is any reason

Re: where to place ah or al ?

Posted: Wed Dec 03, 2008 5:59 pm
by Combuster
Does it make a difference to send mail to your left or right neighbour?

Re: where to place ah or al ?

Posted: Wed Dec 03, 2008 6:33 pm
by CodeCat
al and ah are two distinct registers, just as for example eax and ebx are. So ask yourself the same question about eax and ebx, and obviously it makes no sense anymore. ;)

Re: where to place ah or al ?

Posted: Wed Dec 03, 2008 9:02 pm
by Zenith
However, don't forget that al and ah make up the lower and higher 8 bits of ax, respectively. You'd do operations on ah if you only wanted to change the contents of the high 8 bits of ax.

Hope this helps!