You are on page 1of 3

Question No 1: As discussed in lectures that 02h is the single character display service and INT 21h

causes to display the single character stored in Dl. If Dl register contains the ASCII Code of some
controller function and the Ah contains 02h service then the INT 21h will cause the controller function
to be execute.

For example. MOV Ah, 02h

MOV Dl,A

INT 21h

The above instruction set contains the controller function of line feed in Dl, When this instruction set
will run it will show the new line added on display screen. Problem: Following are some controller
functions 7

You are required to a. Discuss the function of each controller function. b. Execute each controller
function and discuss working in detail.

Answer:

# 07H- waits for a character from standard input

- does not echo

if there is no character in the keyboard buffer, the function waits until any key is pressed.

example:

mov ah, 7

int 21h

08H- keyboard input without echo

- Same as function 01H but not echoed


# 09H- string display

- Displays string until ‘$’ is reached.

- DX should have the address of the string to be displayed.

The string must be terminated by a '$' character.

DS must point to the string's segment, and DX must contain the string's offset:

.data string BYTE "This is a string$"

.code mov ah,9

mov dx,OFFSET string

int 21h

0Ah - Line feed (moves to next output line)

MOV Ah,02h

MOV Dl,0Ah

Int 21h

MOV Ah,02h

MOV Dx,10d

Int 21h

0Dh - Carriage return (moves to leftmost output column)

MOV Ah,02h

MOV Dl,0Dh

Int 21h

MOV Ah,02h

MOV Dx,13d

Int 21h

You might also like