Chapter
1
I
System Calls
ConStringInput
Buffered Keyboard Input
Function
Call
OAH
Waits for characters to be typed, reads characters from the
keyboard, and places them in an input buffer until
[ENTER]
is pressed. Characters are placed in the buffer beginning
at the third byte. If the buffer fills to
1
less than the
maximum specified, then additional keyboard input is ig-
nored and ASCII
7
(BEL) is sent
to
the display until
[ENTER]
is pressed.
The string can be edited
as
it is being entered.
If
CON-
TROL-C is typed, Interrupt
23H
is executed.
The input buffer pointed to by
DS:DX
must be in this
form:
byte
1
-
Maximum number
of
characters in buffer,
including the carriage return
(1-255;
you set
this value).
byte
2
-
Actual number of characters typed, not in-
cluding the carriage return (the function
sets this value).
bytes 3-n
-
Buffer; must be at least as long as the
number in byte
1.
Entry Conditions:
AH
=
OAH
DS:DX
=
pointer to an input buffer (see above)
E
xi
t
Conditions
:
DS:[DS
+
11
=
number of characters receiued, exchding
the
carriage return
Maw
o
Definition:
get-5tring
macro
limit,~tring
mov
dx,offjet
string
mov
string,limit
m0v
ah,OAH
int
21
H
endm
43