CP/M call 10, Read Console Buffer, has a range of additional facilities.
The read buffer reads a line of edited console input into a buffer addressed by registers DE. Console input is terminated when either the buffer overflows, or on control J or control M.
The Read buffer is of the form:
DE | +0 | +1 | +2 | +3 | +4 | +5 | ...... | +N | | mx | nc | c1 | c2 | c3 | c4 | ...... | ?? |
where ms is the mamimum number of characters the buffer will hold (1 to 255).
nc number of characters read (set by DEMOS on return). nc is followed by c1, c2, etc., the characters read from the console.
If nc < mx then uninitialised positions follow the last character (represented by ?).
A number of control functions are recognised during line edit:
|Control C||reboots system if at start of line|
|Control E||causes physical end of line|
|Control H||backspace one character position|
|Control J||terminate input|
|Control M||terminate input|
|Control R||retype current line after new line|
|Control X||backspaces to beginning of current line|