FUNCTION  1:  Console Input      
FUNCTION  2:  Console Output     
FUNCTION  3:  Reader Input         
FUNCTION  4:  Punch Output       
FUNCTION  5:  List Output         
FUNCTION  6:  Direct Console I/O 
FUNCTION  7:  Get I/O Byte       
FUNCTION  8:  Set I/O Byte       
FUNCTION  9:  Print String       
FUNCTION 10:  Read Console Buffer 
FUNCTION 11:  Get Console Status 
:FUNCTION  1:  CONSOLE INPUT

-----------------------------------------------------------------
|       Entry Parameters       |         Returned Value         |
|------------------------------|--------------------------------|
| Register  (C): 01H           | Register  (A): ASCII Character |
-----------------------------------------------------------------

     Function  to get character from console device.  A byte from 
the  device currently assigned to CON:  is returned  in  register 
(A).  The byte is echoed to the terminal.  If no byte is ready at 
the time the call is made, the calling program is suspended until 
a byte becomes available.
:FUNCTION  2:  CONSOLE OUTPUT

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 01H             |            None              |
| Register  (E): ASCII Character |                              |
-----------------------------------------------------------------

     Function  to output character in register (E) to the  device 
currently  assigned  to  CON:  and expand tabs  if  necessary.  A 
Control-S (pause) and Control-P (echo to printer)  console  input 
test is also performed.
:FUNCTION  3:  READER INPUT

-----------------------------------------------------------------
|       Entry Parameters       |         Returned Value         |
|------------------------------|--------------------------------|
| Register  (C): 03H           | Register  (A): ASCII Character |
-----------------------------------------------------------------

     Function  to get character from the reader device.  The next 
byte  from the device currently assigned to RDR:  is returned  in 
register  (A).  All 8 bits are returned.  The calling program  is 
suspended until a byte is ready.
:FUNCTION  4:  PUNCH OUTPUT

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 04H             |            None              |
| Register  (E): ASCII Character |                              |
-----------------------------------------------------------------

     Function to output a character to the punch device. The byte 
in register (E) is sent to the device currently assigned to PUN:. 
The program is suspended until the device is ready to accept  the 
byte.
:FUNCTION  5:  LIST OUTPUT

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 05H             |            None              |
| Register  (E): ASCII Character |                              |
-----------------------------------------------------------------

     Function to output a character to the list device.  The byte 
in register (E) is sent to the device currently assigned to LST:. 
The  program is suspended until the device is ready to accept the 
byte.
:FUNCTION  6:  DIRECT CONSOLE I/O

-----------------------------------------------------------------
|       Entry Parameters            |    Returned Value         |
|-----------------------------------|---------------------------|
| Register (C): 06H                 | Register (A): ASCII Char  |
| Register (E): 0FFH       (input)  |                 or        |
|               0FEH       (status) |               status      |
|               ASCII Char (output) |                           |
-----------------------------------------------------------------

     Function  to  perform direct console i/o.  If  register  (E) 
contains  (FF)  then this is an input request.  If  register  (E) 
contains  (FE)  then  this is a  status  request.  Otherwise  the 
character  in register (E) will be sent to the  device  currently 
assigned  to  CON:.  This request bypasses all control  character 
checks.
:FUNCTION  7:  GET I/O BYTE

-----------------------------------------------------------------
|       Entry Parameters       |         Returned Value         |
|------------------------------|--------------------------------|
| Register  (C): 07H           | Register  (A): I/O Byte Value  |
-----------------------------------------------------------------

     Function  to return the i/o byte.  The current value of  the 
IOBYTE (memory location 0003H) is returned in register (A).













     The  I/O byte located at memory location 0003H is made up of 
the four fields shown in the following table:

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

                    Table 4-2: IOBYTE Format
:FUNCTION  8:  SET I/O BYTE

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 08H             |            None              |
| Register  (E): I/O Byte Value  |                              |
-----------------------------------------------------------------

     Function to set the i/o byte. The value in (E) is set as the 
current IOBYTE (memory location 0003H). It changes control of the 
output direction immediately.











     The  I/O byte located at memory location 0003H is made up of 
the four fields shown in the following table:

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

                    Table 4-2: IOBYTE Format
:FUNCTION  9:  PRINT STRING

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 09H             |            None              |
| Register (DE): String address  |                              |
-----------------------------------------------------------------

     Function  to send the character string pointed to by (DE) to 
the device currently assigned to CON:. The printing of the string 
to the console device will continue until a '$' is encountered in 
the string.  Console input control character checks are made  and 
tabs are expanded.
:FUNCTION 10:  READ CONSOLE BUFFER

-----------------------------------------------------------------
|       Entry Parameters         |       Returned Value         |
|--------------------------------|------------------------------|
| Register  (C): 0AH             | Console Characters in Buffer |
| Register (DE): Buffer address  |                              |
-----------------------------------------------------------------

     Function to execute a buffered read. ZRDOS notes the current 
cursor  position as it knows it,  then reads characters from  the 
console device until a CR or LF is received, or until the maximum 
number of characters have been received. 

     ZRDOS  unlike standard bdos treats the rubout (del) key  the 
same  as  a  backspace.  Also  the control-R  function  has  been 
eliminated.






The form of the read buffer is as follows:

BASE = Address in (DE)

         BASE           BASE + 1   BASE +2 to end of buffer 
     ------------------------------------------------>>-----
     | Max # of chars | char cnt |        characters       | 
     ------------------------------------------------>>-----

                    Console Buffer Format
:FUNCTION 11:  GET CONSOLE STATUS

-----------------------------------------------------------------
|       Entry Parameters       |         Returned Value         |
|------------------------------|--------------------------------|
| Register  (C): 0BH           | Register  (A): Console Status  |
-----------------------------------------------------------------

     Function  to  interrogate  the console  device.  The  device 
currently  assigned to CON:  is polled.  If a byte is  ready  for 
input, a nonzero value is returned in register (A), otherwise 00H 
is returned.
