Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ah and al registers query

Status
Not open for further replies.

newbieatassembly

Technical User
Oct 4, 2000
39
0
0
IN
Hi,

I was just trying to do
asm {
mov ah, 0x00
mov ax, 0x13
int 0x10
}

It looks as though I don't have to set ah to 0, to make it work but yet I see all the codes setting ah to 0.

Could anyone please explain why I don't have to set ah to 0 and why do everyone do it when its not necessary ??

Thank you.
 
Hello,
The 16-bit AX register contains two 8-bit registers, AH and AL.
By saying 'mov ax, 0x13' you are actually saying 'mox ax,0x0013' which means 'mov ah,0x00', 'mov al,0x13'.
So, you are doing it twice.
The code you write is supposed to be 'mov ah,0x00', 'mov al,0x13', or 'mov ax,0x13'
Wouter Dijkslag

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top