Subttl Introduction -- Directives
Search MONSYM,MACSYM ; Standard 20 universals
.Requi SYS:MACREL ; Support code
Sall ; Nice and neat listing
.Direc .Xtabm ; Give macro a break
Comment \
GIGI is a collection of routines written to support FORTRAN
programs. Its main purpose is to provide a easy method for said
programs to pass commands to the GIGI terminal.
These routines make some assumptions as to the arguments passed and
FORTRAN conventions. They are:
o All strings end with the null byte.
o All strings are in ASCII, one char per word.
o All function calls are integer in type, and return
their value in register zero.
The following is a list of all subroutines/function defined:
INTEGER FUNCTION getln (inbuf, maxlen, ecflag)
SUBROUTINE putln (outbuf, len)
SUBROUTINE escseq (str)
SUBROUTINE ttnorm
INTEGER FUNCTION prmtgt (outbuf, len, inbuf, maxlen)
INTEGER FUNCTION ttin (ecflag)
FUNCTION ttinnw (ecflag)
SUBROUTINE escseq (str)
\

Subttl Subroutines -- Function TTIN (Get a character)
; Function TTIN (ecflag)
;
; This function returns the ASCII code for the next character
; available from the terminal. That character is returned as soon as
; it is typed; this method of input is not suitable if normal
; line-editing functions are desired. If no character is available,
; the program will be hung until one is obtained. If integer value
; "ecflag" is zero, the character is not echoed to the user.
SBR TTIN
TTIN01: SKIPE W1,@0(ARG) ; Get state of echo flag
CALL ECHON ; q.e.d.
SKIPN W1
CALL ECHOFF
JSYS (PBIN) ; Get a character
MOVE FV,A ; Return it to caller
RET

Subttl Subroutines -- Function TTINW (get character if available)
; Integer Function TTINNW (ecflag)
; This function tests to see if a character is available from the
; terminal. If no character is available it returns a zero. Otherwise
; it will return the ASCII value of the character.
SBR TTINNW
MOVEI A,.PRIIN ; Test if character is waiting
SIBE ; Empty?
JRST TTIN01 ; Nope get it
SETZ FV, ; Return zero
RET