Expand description
A character console.
| Offset | Register | Behaviour |
|---|---|---|
| 0 | DATA | Write emits a byte. Read consumes one input byte, or -1 if the queue is empty. |
| 1 | STATUS | 1 input waiting, 0 none yet, -1 end of input. |
§A status with three values
A binary console’s status register answers one question: is a character ready? A driver that gets “no” cannot tell whether to wait or to give up, and every such system grows a second mechanism to say which.
One trit answers both. Positive means a character is waiting. Zero means none is waiting yet and more may come, so a driver should wait. Negative means the input has ended and none ever will, so a driver should stop.
An interactive host leaves the console open and the guest waits; a batch host closes it after queueing its input and the guest terminates on its own. Neither needs a convention outside the register.
Structs§
- Console
- A console with a byte output buffer and a byte input queue.