
THE INTERRUPT STRUCTURE OF 8086 277
Example 8.11
e following program fi lls up the screen with the key pressed. If no key is pressed, it keeps
waiting for a key press.
.MODEL TINY
.CODE
.STARTUP
NO_KEY: MOV AH, 11H ;function for waiting for key
INT 16H
JZ NO_KEY ;if ZF = 1, no key press, keep waiting
KEY: MOV AH, 10H ;function for taking into AL the key
INT 16H
MOV CX, 2000 ;number of characters to fi ll the screen
DISP: MOV DL, AL ;move the ASCII character to DL
MOV AH, 02 ;function number to display DL content
INT 21H ;DOS interrupt 21H
LOOP DISP ;display until CX = 0
.EXIT
END
e program of Example 8.11 uses INT 16H function ...