.f .ifnot manual .RM 64 .NO NUMBER .NO PAGING .STHL 5,1,1 .endif manual .if manual .hl 1 TTYIO - TERMINAL OUTPUT ROUTINES FOR VAX MACRO PROGRAMS .else manual .nf 2 TTYIO ! ! DEC-10 style terminal I/O routines ! .f .endif manual .if manual Warning -- TTYIO is useful only to the experienced MACRO programmer. Anyone who is not familiar with VAX MACRO should not bother with it. Experience with the DEC-10 is also handy. .s 1 .endif manual 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. .s 1 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). .if manual .hl 2 Authors of TTYIO .else manual .br 3 Authors .BR .endif manual 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. .ifnot manual If there are any questions about or problems with TTYIO, please report them via MAIL to OMNIGRAPH. .endif manual .if manual .hl 2 GETLCH and SETLCH - Line characteristics control .else manual .BR 3 GETLCH .br .endif manual 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: .S 1 .NF 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 . 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). .f .if manual .hl 2 Buffering in TTYIO .else manual .br 3 Buffers .br .endif manual 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. .S 1 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. .if manual .hl 2 Calling TTYIO routines .else manual .br 3 Calls .BR .endif manual The calling sequence for all entries is handled via macros. These macros are defined in the macro library .S 1 .I 8 DEV:[OMNIGRAPH.TOOLBOX]TTYIO.MLB. .S 1 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. .S 1 The functions supplied (presented as macro invocations) follow: .NF .S 1 RESCAN Initialize to re-read last line. .S 1 INCHRW L Input a character to location L. .S 1 INCHWL L Input a character to location L. Wait for an entire line if no characters immediately available. .S 1 OUTCHR L Output the character in location L. .S 1 OUTSTR L Output the ASCIZ string from location L. .S 1 CLRBFI Clear type-ahead. .S 1 SETLCH L Set characteristics longword from location L. .S 1 GETLCH L Get characteristics longword from location L. .if manual .hl 2 Location of the TTYIO routines .else manual .br 3 Location .br .endif manual The sources to the TTYIO package are contained in the following files: .s 1 .nf DEV:[OMNIGRAPH.UTILITY]TTYIOMACS.MAR Macro library source DEV:[OMNIGRAPH.UTILITY]TTYIO.MAR Actual TTYIO routines .f .s 1 TTYIO routines must be linked to for proper execution. TTYIO is contained in the object library POWELL. The link command is: .S 1 .I 8 $ LINK YOURFILE,TOOLS:POWELL/LIB