Int 2Fh / 4810h Read Command Line DOS 5.0+
Reads a line of up to 126 characters from the console and copies
it to the specified buffer. While the line is being read, all
DOSKEY function keys and macros are enabled. This means, for
example, that the user can select a line from the DOSKEY history,
edit a line, or enter macros that are automatically expanded.
Entry AX = 4810h
DS:DX = Pointer to 128-byte line buffer
(1st byte initialized to 128)
Return AX = 00h Line buffer filled
or
AX > 00h Function failed
──────────────────────────────────────────────────────────────────
The line buffer that receives the command line must have the
following format:
Offset Contents
00h The maximum size of the buffer (must be 128 (80h))
01h A number that is one less than the number of
characters read. The function copies a carriage-
return (ASCII 0Dh) to the buffer but does not include
the byte in its total.
02h The first byte of the input line.
If the user types a macro name, AX contains zero but no text is
copied to the buffer. Instead, the program must immediately call
the function a second time to expand the macro and copy the macro
text to the buffer.
This function adds the command line to the DOSKEY history. If the
user types a macro name or a special parameter (such as $*), the
program must call the function a second time to expand the macro
or parameter. On the second call, the function automatically
writes the expanded macro to the screen, overwriting the macro
name. It also copies the expanded macro text to the line buffer.