Sie sind auf Seite 1von 5

DOS & BIOS Interrupts

BIOS Interrupts

INT 16h :- for Keyboard Input

These interrupts include reading a character from keyboard & getting the status of the keyboard. 1.Function 10h:- (Read keyboard character)
This standard keyboard operation checks the keyboard buffer for an entered character. If none is present, it waits for the use to press a key. If a character is present, the ASCII code of the key is returned to AL & its scan code to AH register
Eg: MOV AH,10h INT 16h CMP AL, Y JE Enter The key pressed is not shown on the screen. 2. Function 11h:- (Determine if character is present)
If the character is present in the keyboard buffer, this operation clears the ZF returns the character to AL & its scan code to AH & character remains in the buffer.

If no character is present, the operation sets the ZF & does not wait for a key like the function 10h.

INT 10h :- for Video Services

BIOS INT 10h supports many services to facilitate 1.Function 00h :- (Set video mode) A video made scan be text mode or graphics mode. The generally used video mode is 25 rows X 80 columns, color, text mode . To set a mode we have to load function code in to AH & mode number into AL. Ex: MOV AH,00h ; loading function code MOV AL, 03h ; standard color text. INT 10h ; call interrupt service routine
2. Function 05h :-( select active page) Function 05h lets you select the page that is to be displayed in text or graphics made. We can create new pages & request alternating between pages Eg:MOV AH, 05H ; Request active page MOV AL ,00h ; page 0 is selected INT 10h 3. Function 02h :- (Set cursor position) This function is used to set the cursor position anywhere on the screen.

The Row no. & Column no. are given in DH & DL registers & the BH register should contain the page no. Eg:MOV AH, 02h
; request to set cursor MOV BH, 00h ; page 00h MOV DH, 16 ; Row=16 MOV DL, 32 ; Column=32 INT 10h

4. Function 03h :- ( Return curser status) This function is used to determine the position of curser & the size of the curser. The page No. has to be mentioned in BH register. Ex: MOV AH, 03h ; Request curser location MOV BH, 00h ; Page No: is 0 INT 10h
Out put : DH: row No. DL; column No. CH : Starting Scan time CL : Ending Scan time.
5. Function 09h :( Display character & Attribute) This operation displays specified No. of characters on the screen accordingly to the given attribute. The character is displayed at the current position of cursor. AL----- ASCII character BL----- Attribute value BH---- Page No. CX --- count Ex: The following code prints ten Ts


INT 10h

AH, 09h ;Request Display AL, T ;T to be displayed BH, 00h ;page 0 BL, 02 h ;black back-ground & green fore ground CX , 0A h ; counter ( ie. 10Ts)

DOS Interrupts INT 21h :1. Function 01h :- (keyboard input with Echo) This is similar to INT 16hs 10h function but this function displays keyboard & does not return scan mode. After the interrupt ; we have ASCII code in AL To get a scan code for this key in AL, we should repeat INT 21h immediately. Ex: MOV ah, 01H ; Request keyboard input INT 21h

2. Function 07h :- (Keyboard input without Echo) It is like function 01h, except that it doesnt echo the key onto the display. This is useful for accepting passwords that are to be invisible.

Eg: MOV AH, 07h ; request keyboard input INT 21h

3. Function 0Bh :- (check keyboard status) - This operation returns FFh in AL if input character is available in the keyboard buffer - 00h if no character is available. This doesnt wait for the user to press the key
4. Function 02h :- (Screen display) - This is useful for displaying single characters. DL character Ex: MOV AH, 02h ;request character display MOV DL, S INT 21h 5. Function 09h :- (Displaying strings) - This function requires the string to be displayed to end with a $ sign.
Ex: String DB Enter your name: $ MOV AH, 09h ; request display LEA DX, String ; load address INT 21h