Chapter
1
I
System Calls
C
onInput Status
Check
Keyboard Status Function Call
OBH
Checks
to
see if a character is available in the type-
ahead buffer. If CONTROL-C is in the buffer, Interrupt
23H is executed.
Entry Conditions:
AH
=
0BH
Exit Conditions:
If AL
=
FFH, there are characters in the type-ahead
buffer.
If
AL
=
00H, there are no characters in the type-ahead
buffer.
Macro Definition:
check-kbd-5tatu5 macro
mov
ah,
0BH
int
21
H
endm
Example:
The following program continuously displays the time until
any key is pressed.
time db "00: 00: 00. EO",
13,l
0
,"$'I
ten db
10
f
unc-0BH: get-time
convert ch,ten, time
convert cl,ten, time[31
convert dh,ten,
tlme[61
convert dl,ten, time[91
display time
check-kbd-status
cmp a1,OFFH
le all-done
Imp func-OBH
all-done: ret
;5ee Function
2CH
;see end
of
chapter
;see end
of
chapter
;5ee
end
of
chapter
;5ee
end
of
chapter
;see Function 09H
;THIS
FUNCTION
;ha5
a
key been typed?
;yes,
go
home
;no,
keep displaying
;
t
ime
45