Slide 15 - Instructions - InT 21h Interrupts
Slide 15 - Instructions - InT 21h Interrupts
Laboratory
EEE220
slide 1
INT 21h interrupts
The INT 21h interrupts are DOS system services that allow programs to perform various functions such
as input/output operations, file handling, and system management.
They are called by setting specific values in the AH register to select a particular function.
Example Usage
Input a character and display it
mov ah, 01h ; Function to read a character
int 21h ; Call DOS interrupt
mov dl, al ; Move input character to DL
mov ah, 02h ; Function to display a character
int 21h ; Call DOS interrupt
INT 21h interrupts
Input/Output Functions
1. AH = 01h: Input a single character from the keyboard (echoed to the screen).
○ Returns: ASCII character in AL.
2. AH = 02h: Output a single character to the screen.
○ Input: Character in DL.
3. AH = 09h: Display a string on the screen.
○ Input: Address of the string in DX (terminated with $).
4. AH = 0Ah: Buffered input.
○ Input: Address of buffer in DX. First byte specifies max length; second byte gets the actual length.
INT 21h interrupts
File Handling
Program Termination
Memory Management
System Functions
Keyboard Functions