Dos Functions in 8086 Programming
Dos Functions in 8086 Programming
The Intel CPU recognizes two types of interrupts namely hardware interrupt when a peripheral
devices needs attention from the CPU and software interrupt that is call to a subroutine located
in the operating system. The common software interrupts used here are INT 10H for video
services and INT 21H for DOS services.
INT 21H:
It is called the DOS function call for keyboard operations follow the function number. The
service functions are listed below:
# 01H
MOV, AH 01H; request keyboard input INT 21H
- Returns character in AL. IF AL= nonzero value, operation echoes on the screen. If Al=
zero means that user has pressed an extended function key such as F1 OR home.
# 02H
MOV AH, 02H; request display character
MOV DL, CHAR; character to display
INT 21H
- Display character in D2 at current cursor position. The tab, carriage return and line feed
characters act normally and the operation automatically advances the cursor.
# 09H
MOV Ah, 09H; request display
LEA DX, CUST_MSG; local address of prompt
INNT 21H
CUST_MSG DB “Hello world”, ‘$’
- Displays string in the data area, immediately followed by a dollar sign ($ or 24H), which
uses to end the display.
# OAH
MOV AH, 0AH ; request keyboard input
LEA DX, PARA_ LIST ; load address of parameter list
INT 21H
- LABEL directive tells the assembler to align on a byte boundary and gives location the
name PARA _LIST.
- PARA_LIST & MAX_LEN refer same memory location, MAX_LEN defines the maximum
no of defined characters.
- ACT_LEN provides a space for the operation to insert the actual no of characters
entered.
- KB_DATA reserves spaces (here 20) for the characters.
Example:
TITLE to display a string
.MODEL SMALL
.STACK 64
.DATA
STR DB ‘programming is fun’, ‘$’
.CODE
MAIN PROC FAR
MOV AX, @DATA
MOV DS, AX
MOV AH, 09H ;display string LEA
DX, STR
INT 21H
MOV AX, 4C00H
INT 21H
MAIN ENDP
END MAIN
INT 10H
It is called video display control. It controls the screen format, color, text style, making
windows, scrolling etc. The control functions are:
# 00H – set video mode
MOV AH, 00H ; set mode
MOV AL, 03H ; standard color text
INT 10H ; call interrupt service
23
Microprocessors lecture 6: Programming with 8086 Microprocessor
END MAIN