Chapter4 - DOS Programming
Chapter4 - DOS Programming
Programming
Dr. Ali Mohamed
Faculty of Engineering at Aswan
Aswan University
Objectives
Interrupts
MOV AH, 01
INT 21H
This function waits until a character is input for the keyboard, then echoes
it to the monitor.
The input character (ASCII) will be in AL
Without echo
MOV AH, 07
INT 21H
MOV AH, 02
MOV DL, ‘M’
INT 21H
DL is loaded wit the character to be displayed
The carriage return code 0D H
The line feed code 0A H
MOV AH,4CH
INT 21H
MOV AH, 01
INT 16
ZF = 0 if a key is pressed and ZF = 1 otherwise
MOV AH, 00
INT 16
The ASCII code for the pressed code is stored in AL
From 1 to 7
From 9 to 11
Display the mouse cursor this can be done by AX = 01 then INT 33H to
hide it use AX = 02 then INT 33H
1. The option AX = 3 can get the current position of the mouse, the
horizontal position will be in CX and vertical in DX. The position is
given in pixels.
2. The option AX = 4 can set the position of the mouse, the
horizontal position will put in CX and vertical in DX. The position is
given in pixels.
3. The option AX = 5 can obtain which button is pressed of the
mouse. Upon return from INT 33H we find,
AX the status of the key pressed where,
D0 = Left button, 1 if down and 0 if up
D1 = center button, 1 if down and 0 if up
D2 = Right button, 1 if down and 0 if up
BX button press count
CX and DX is the coordinates of the last press.