0% found this document useful (0 votes)
302 views

DOS Interrupts

The document discusses software interrupts in computers. An 'int' instruction is like a subroutine call that interrupts regular program flow. Both the BIOS and DOS use software interrupts to provide input/output services. The 'int 21h' interrupt provides various DOS functions by setting registers like 'AH' to select the function, such as outputting a character or string to the screen, getting input from the keyboard, and exiting back to DOS.

Uploaded by

mb_4u
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
302 views

DOS Interrupts

The document discusses software interrupts in computers. An 'int' instruction is like a subroutine call that interrupts regular program flow. Both the BIOS and DOS use software interrupts to provide input/output services. The 'int 21h' interrupt provides various DOS functions by setting registers like 'AH' to select the function, such as outputting a character or string to the screen, getting input from the keyboard, and exiting back to DOS.

Uploaded by

mb_4u
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Software Interrupt Instruction int

A int instruction is like a special kind of subroutine call. Will discuss details later int stands for INTERRUPT the int instruction is called a software interrupt The format of an int instruction is : int number where number can be value 0-255

DOS, BIOS INT Functions


Both the BIOS (Basic Input and Output System) and DOS (Disk Operating Systems) uses software interrupts to provide Input/Output services to the assembly language programs
The BIOS is contained in ROM and is operating system independent (the same BIOS is used for WinNT, Linux, Win98, etc) DOS is only available under WinNT/Win98/WinME and is only supported for compatibility reasons.

DOS 21H Functions


The int 21h software interrupt provided by DOS provides a variety of different functions. The ah register is used to select which function you want to use. Other registers may used to pass parameters to the function. Some useful functions:

OUTPUT functions

Some Useful INT 21H functions

AH = 2, output a character to screen, character in DL AH = 9, output a string to screen, address of string in DX

INPUT functions
AH = 1, wait for Character to be typed, return character in AL. Character is also echoed to screen AH = 6, DL=0FFh, checks if character is available. If available, return in AL with Zero Flag = 0. If no character is available, return with ZERO flag = 1. Note that this function DOES NOT wait for a character to be typed. AH = 0Ah get an entire string from the user (we will look at this in more detail later).

MISC AH= 4C, AL = 00 (AX=4C00 h), Exit back to DOS.

You might also like