


2 TTYIO
!
! DEC-10 style terminal I/O routines
!
TTYIO is a collection of  terminal  routines  that  emulate  the
monitor  calls  available on a DECSYSTEM-10.  They are available
via VAX macro only  --  they  are  not  accessible  through  any
high-level language interfaces at this time.

An argument to a TTYIO routine, where required,  is  an  operand
address  or  a register containing the operand.  On the VAX only
registers  R0  through  R11  may  be  specified.   Strings   are
automatically  terminated,  if  they  have  not  been previously
terminated, by R12.  A character is an eight  bit  byte,  and  a
string  is  a  sequence  of  characters  terminated  by (and not
including) the first zero byte (an ASCIZ string).
3 Authors
The TTYIO package was written by Management Science  Associates,
Inc.   of  Pittsburg.  This version is supplied by the OMNIGRAPH
project and has been modified by Kevin Carosso.   If  there  are
any  questions  about or problems with TTYIO, please report them
via MAIL to OMNIGRAPH.
3 GETLCH
The arguments to GETLCH (Get Line  Characteristics)  and  SETLCH
(Set  same) differ from the '10;  all "characteristics" here are
modifiers to the QIO functions IO$_READVBLK  and  IO$_WRITEVBLK.
The  modifiers  are formatted as a longword, with the first word
being or'ed with the input function code, and  the  second  with
the output function code.  The characteristics longword may thus
have any of the following bits set:

    IO$M_NOECHO       Don't echo input.
    IO$M_CVTLOW       Convert lower to upper case (default).
    IO$M_NOFILTR      Don't interpret U, R and <DEL>.
    IO$M_TRMNOECHO    Don't echo terminator on input.
    IO$M_CANCTRLO@16  Turn off O (if on) before output.
    IO$M_NOFORMAT@16  Don't interpret output chars (default).
3 Buffers
All input is buffered.  No  output  is  buffered.   Consequently
there  is  no  CLRBFO  function  supplied.   The CLRBFI function
clears  both  the  system  type-ahead  buffer  and  the   buffer
maintained by TTYIO.

RESCAN causes the  line  buffer  pointer  to  be  reset  to  the
beginning  of  the  buffer if, in fact, there is anything in the
buffer.  Should the buffer contain no characters  (the  case  if
rescan is used before any input call), then a callback to CLI is
performed.  Note this does not produce the last  line  typed  to
the terminal a la DEC-10.
3 Calls
The calling sequence for all  entries  is  handled  via  macros.
These macros are defined in the macro library

        DEV:[OMNIGRAPH.TOOLBOX]TTYIO.MLB.

Of note is that the channel  number  in  the  common  data  page
$TTYIODATA  is  initialized to -1 so that TTYIO can recognize an
initial entry and obtain a terminal channel which  it  maintains
until image exit.

The functions supplied (presented as macro invocations) follow:

    RESCAN        Initialize to re-read last line.

    INCHRW  L     Input a character to location L.

    INCHWL  L     Input a character to location L.
                     Wait for an entire line if no
                     characters immediately available.

    OUTCHR  L     Output the character in location L.

    OUTSTR  L     Output the ASCIZ string from location L.

    CLRBFI        Clear type-ahead.

    SETLCH  L     Set characteristics longword from location L.

    GETLCH  L     Get characteristics longword from location L.
3 Location
The sources to the TTYIO package are contained in the following
files:

     DEV:[OMNIGRAPH.UTILITY]TTYIOMACS.MAR  Macro library source
     DEV:[OMNIGRAPH.UTILITY]TTYIO.MAR      Actual TTYIO routines

TTYIO routines must be linked to for proper execution.  TTYIO is
contained in the object library POWELL.  The link command is:

        $ LINK YOURFILE,TOOLS:POWELL/LIB
