Chapter
1
I
System
Calls
ConInput
Direct Console Input Function Call
87H
Waits for
a
character to be typed
at
the keyboard, and
then returns the character. This call does not echo the
character or check for CONTROL-C. (For
a
keyboard input
function
that
echoes or checks for CONTROL-C, see Func-
tion Call OIH or 08H.)
Entry Conditions:
AH
=
07H
Exit Conditions:
AL
=
character from keyboard
Macro
Definition:
Dir-console-input macro
mov ah,07H
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:
$"
;5ee Function 09H for an
db
8
dup(7)
;explanation
of
0
func-07H: display prompt
mov
CY,
8
xor bx,bx
ge t-pass
:
dir-console-input
cmp al,0DH
]e continue
mov password[bxl,al
inc bx
loop
get-pass
continue:
;5ee Function 09H
;maximum length
of
;password
;so
BL
can be used
as
;index
;THIS
FUNCTION
;wa5
it
a
CR?
;yes,
all
done
;no,
put
character in
;
5
tr ing
;bump index
;get another character
;EX
ha5 length
of
;password
+
1
40