Device 0 Details

Top  Previous  Next

Output. Output to device 0 directs characters to the simulated VGA console device. It displays ASCII characters and handles certain control characters such as tab, form feed (clears screen), bell, carriage return, line feed, and backspace. Text reaching the end of a line automatically wraps to the beginning of the next line. Text written beyond the bottom line scrolls the entire screen up one line. Tab stops are every eighth column.


Input. Input from device 0 receives characters from a buffered keyboard. Characters are echoed on the simulated console as they are entered, but the buffer holds them until the Enter (or Carriage Return) key is struck. This enables editing using the Backspace key before the characters are sent to the program. The buffer holds up to 128 characters including the carriage return ($0D) at the end. Typing an Esc deletes all the characters in the buffer. (Esc cannot be entered as a character.) Typing Ctrl+C aborts the program.


Initialization. Opening device 0 with the OpenI(0) intrinsic initializes the keyboard, which discards any characters that were previously struck and still residing in the buffer. OpenO(0) and Close(0) do nothing.