 Function  1:  Console Input     -- Device I/O Functions --
 Function  2:  Console Output
 Function  3:  Auxiliary Input (Reader)  
 Function  4:  Auxiliary Output (Punch)
 Function  5:  List Output 
 Function  6:  Direct Console I/O
 Function  7:  Get IOBYTE
 Function  8:  Set IOBYTE
 Function  9:  Print String
 Function 10:  Read Console Buffer 
 Function 11:  Get Console Status
:

     +---------------------------------------------------------------+
     |                  FUNCTION 1 -- CONSOLE INPUT                  |
     +------------------------------+--------------------------------+
     | Entry:  C = 1 (01h)          | Exit:  A = Character           |
     |                              |                                |
     |                              |                                |
     +------------------------------+--------------------------------+

Returns the next character from the system console.  If no character is 
ready, this function waits for one before returning.

Printable characters, carriage return, line feed, and backspace are echoed 
to the console unchanged.  Tabs are expanded with spaces.  No other control 
characters are echoed.

If Control-S is entered, console output is suspended until another 
character is entered.  If a Control-C is entered following a Control-S, the 
error mode is reset to the default and a warm boot is executed.  Any other 
character causes console output to resume.
:

     +---------------------------------------------------------------+
     |                 FUNCTION 2 -- CONSOLE OUTPUT                  |
     +--------------------------------+------------------------------+
     | Entry:  C = 2 (02h)            | Exit:  None                  |
     |         E = Character          |        (A = BIOS A register) |
     |                                |                              |
     +--------------------------------+------------------------------+

Sends the character in the E register to the system console.  Printable 
characters, carriage return, line feed, and backspace are echoed to the 
console unchanged.  Tabs are expanded with spaces.  No other control 
characters are echoed.

The console is also checked for a Control-S.  If Control-S is entered, 
console output is suspended until another character is entered.  If a 
Control-C is entered following a Control-S, the error mode is reset to the 
default and a warm boot is executed.  Any other character causes console 
output to resume.

This function should not be used for outputting video terminal control 
codes.  Instead, use Function 6.
:

     +---------------------------------------------------------------+
     |            FUNCTION 3 -- AUXILIARY INPUT (READER)             |
     +------------------------------+--------------------------------+
     | Entry:  C = 3 (03h)          | Exit:  A = Character           |
     |                              |                                |
     |                              |                                |
     +------------------------------+--------------------------------+

Returns the next character from the current auxiliary device.  If no 
character is ready, this function waits for one before returning.

No control character filtering is done.
:

     +---------------------------------------------------------------+
     |            FUNCTION 4 -- AUXILIARY OUTPUT (PUNCH)             |
     +--------------------------------+------------------------------+
     | Entry:  C = 4 (04h)            | Exit:  None                  |
     |         E = Character          |        (A = BIOS A register) |
     |                                |                              |
     +--------------------------------+------------------------------+

Sends the character in the E register to the current auxiliary device.  The 
function will wait for the device to accept the character.

No control character filtering is done.
:

     +---------------------------------------------------------------+
     |                   FUNCTION 5 -- LIST OUTPUT                   |
     +--------------------------------+------------------------------+
     | Entry:  C = 5 (05h)            | Exit:  None                  |
     |         E = Character          |        (A = BIOS A register) |
     |                                |                              |
     +--------------------------------+------------------------------+

Sends the character in the E register to the current LST device.  The 
function will wait for the device to accept the character.  The BIOS list 
output routine is not called before sending the byte.
:

     +---------------------------------------------------------------+
     |               FUNCTION 6 -- DIRECT CONSOLE I/O                |
     +--------------------------------+------------------------------+
     | Entry:  C = 6 (06h)            | Exit:                        |
     |         E = FFh (Input)        |   A = Character (0 = None)   |
     |         E = FEh (Input)        |   A = Status (0 = No Char)   |
     |         E = FDh (Input)        |   A = Character              |
     |         E = 00h-FCh (Output)   |   None (A = BIOS A register) |
     +--------------------------------+------------------------------+

Performs direct console I/O with no character interpretation.  The contents 
of register E determine what this call does:

     FFh = Return next console character, or 0 if no character is available.
     FEh = Return console status (0 if no character ready).
     FDh = Return next console character, wait if no character is ready.
 00h-FCh = Output character in E to console.

Terminal video controls should use this function rather than Function 2.
:

     +---------------------------------------------------------------+
     |                   FUNCTION 7 -- GET IOBYTE                    |
     +------------------------------+--------------------------------+
     | Entry:  C = 7 (07h)          | Exit:  A = IOBYTE              |
     |                              |                                |
     |                              |                                |
     +------------------------------+--------------------------------+

Returns the IOBYTE, which is stored at 03h in the zero page.  The byte is 
used by some BIOS's to redirect output, but the contents of the byte are 
implementation dependant.

For a common implementation scheme, see the next screen.

Function 7 (continued)

A common IOBYTE implementation scheme:

         +----------+----------+----------+----------+----------+
         |  IOBYTE: |  7    6  |  5    4  |  3    2  |  1    0  |
         +----------+----------+----------+----------+----------+
         |   bit    |   LST:   |  AUXIN:  |  AUXOUT: |   CON:   |
         |  value   |          |  (PUN:)  |  (RDR:)  |          |
         +----------+----------+----------+----------+----------+
         |    00    |   TTY:   |   TTY:   |   TTY:   |   TTY:   |
         |    01    |   CRT:   |   PTP:   |   PTR:   |   CRT:   |
         |    10    |   LPT:   |   UP1:   |   UR1:   |   BAT:   |
         |    11    |   UL1:   |   UP2:   |   UR2:   |   UC1:   |
         +----------+----------+----------+----------+----------+
:

     +---------------------------------------------------------------+
     |                   FUNCTION 8 -- SET IOBYTE                    |
     +--------------------------------+------------------------------+
     | Entry:  C = 8 (08h)            | Exit:  None                  |
     |         E = IOBYTE             |        (A = IOBYTE)          |
     |                                |                              |
     +--------------------------------+------------------------------+

Sets the IOBYTE, which is stored at 03h in the zero page.  The byte is used 
by some BIOS's to redirect output, but the contents of the byte are 
implementation dependant.

For a common implementation scheme, see Function 7 (Get IOBYTE).
:

     +---------------------------------------------------------------+
     |                  FUNCTION 9 -- PRINT STRING                   |
     +--------------------------------+------------------------------+
     | Entry:  C = 9 (09h)            | Exit:  None                  |
     |        DE = Address of string  |        (A = "$")             |
     |                                |                              |
     +--------------------------------+------------------------------+

Prints a string on the console.  Tabs are expanded to spaces.  The string 
must be terminated with a dollar sign ("$")

The console is also checked for a Control-S.  If Control-S is entered, 
console output is suspended until another character is entered.  If a 
Control-C is entered following a Control-S, the error mode is reset to the 
default and a warm boot is executed.  Any other character causes console 
output to resume.
:

     +---------------------------------------------------------------+
     |              FUNCTION 10 -- READ CONSOLE BUFFER               |
     +--------------------------------+------------------------------+
     | Entry:  C = 10 (0Ah)           | Exit:  None                  |
     |        DE = Buffer address     |        (A = 0Dh)             |
     |                                |                              |
     +--------------------------------+------------------------------+

Reads a string of characters from the console into a buffer.  The buffer, 
whose address is passed in DE, must be set up as follows:
                      Buff+0   Buff+1  Buff+2 -->
                    +--------+-------+---------------->
                    | length | count | input buffer -->
                    +--------+-------+---------------->
The byte at Buff+0 gives the actual length of the input buffer that begins 
at Buff+2 (maximum is 255).  It must be filled in before the call.  The 
byte at Buff+1 is filled in by this function and will give the actual 
number of characters in the input buffer.  Bytes beginning at Buff+2 are 
the characters received from the console (minus any terminating carriage 
return or line feed).

Function 10 (continued)

Input ends when a carriage return or line feed is received or the buffer is 
filled.  If a Control-C is received as the first character in the buffer, 
the program is aborted with a warm boot.  A Control-P will toggle printer 
echo on and off.  Tabs are echoed as spaces and control characters not used 
for editing are echoed as a carat followed by an upper-case letter (that 
is, Control-Z is echoed as "^Z").  The buffer will contain the actual 
characters.

The following keys may be used to edit the line as it is entered from the 
console:
            ^H or DEL -- deletes character to left of cursor.
            ^X or ^U  -- deletes entire line.
               ^R     -- retype line (not for ZDDOS).
:

     +---------------------------------------------------------------+
     |               FUNCTION 11 -- GET CONSOLE STATUS               |
     +------------------------------+--------------------------------+
     | Entry:  C = 11 (0Bh)         | Exit:  A = Console status      |
     |                              |        (0 = no character ready)|
     |                              |        (1 = character ready)   |
     +------------------------------+--------------------------------+

Polls the console to determine whether it has a character ready to send.
