Reputation: 1898
I'm new to learning assembly language, and I'm wondering what the command int 21h
means. For example:
mov ah,01h
int 21h
Which should read a key from the user.
Upvotes: 22
Views: 136034
Reputation: 11353
int 21h
means, call the interrupt handler 0x21 which is the DOS Function dispatcher. the "mov ah,01h" is setting AH with 0x01, which is the Keyboard Input with Echo handler in the interrupt. See:
https://mrszeto.net/CIT/interrupts.htm
Upvotes: 42
Reputation: 11
This simply means that you are using function 01h of the Interrupt type 21... where 01h is as you said is to read character from standard input, with echo, result is stored in AL. if there is no character in the keyboard buffer, the function waits until any key is pressed. It comes under type 21h of various interrput tables, hence the lines of code goes like these as you mentioned.
Upvotes: 1
Reputation: 91
INT 21H will generate the software interrupt 0x21 (33 in decimal), causing the function pointed to by the 34th vector in the interrupt table to be executed, which is typically an MS-DOS API call.
Upvotes: 9