0% found this document useful (0 votes)
34 views3 pages

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

The document discusses DOS interrupt functions for displaying characters and controller functions. It explains that INT 21h with AH=02h displays the character in DL. Controller functions like line feed (0Ah) and carriage return (0Dh) can be executed by moving their ASCII code to DL. The question asks to discuss the functions of 07h, 08h, 09h, 0Ah, and 0Dh and demonstrate their usage. The answer defines each function and provides examples of calling them in assembly code to display a string, get keyboard input, or move the cursor position.

Uploaded by

sameer khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

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

The document discusses DOS interrupt functions for displaying characters and controller functions. It explains that INT 21h with AH=02h displays the character in DL. Controller functions like line feed (0Ah) and carriage return (0Dh) can be executed by moving their ASCII code to DL. The question asks to discuss the functions of 07h, 08h, 09h, 0Ah, and 0Dh and demonstrate their usage. The answer defines each function and provides examples of calling them in assembly code to display a string, get keyboard input, or move the cursor position.

Uploaded by

sameer khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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