Chapter
1
I
System
Calls
ConInputNoEcho
Read Keyboard
Function
Call
08H
Waits for a character
to
be typed at the keyboard, and
then returns it in AL. If CONTROL-C is pressed, Inter-
rupt 23H is executed. This call does not echo the charac-
ter. (For
a
keyboard input function that echoes the
character and checks for CONTROL-C, see Function Call
01H.)
Entry Conditions:
AH
=
rD8H
E
xi
t
Conditions:
AL
=
character from keyboard
Macro Iiefinition:
read-
k
bd macro
mov ah,08H
int
21
H
endm
Example:
The following program prompts
for
a password
(8
charac-
ters maximum) and places the characters into a string
without echoing them.
pa
5
5
word
prompt db "Password:
5"
;see
Function 09H
db
8
dup(7)
;for explanation
of
$
f unc-08H
:
display prompt
mov
CX,~
xor bx,bx
read-k bd
cmp a1,ODH
]e
continue
mov password[bxl,al
inc bx
loop get-pass
ge t-pa5
5
:
continue:
;see
Function 09H
;maximum length
of
;password
;BL
can
be
an index
;THIS FUNCTION
;was
it
a
CR7
;yes,
all
done
;no,
put
char.
in
string
;bump index
;get another character
;BX
ha5 length
of
;password
+
1
41