.MCALL .MODULE .MODULE ITTINR,VERSION=04,COMMENT=,IDENT=NO,LIB=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .SBTTL Module Declaration .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; ITTINR, ITTOUR ; ; ENVIRONMENT: ; ; These routines can be used by any job running in a single-job or ; multi-job environment . They use "TRAP" to provide error processing. ; ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .TTINR ; .TTINR programmed request. .MCALL .TTOUTR ; .TTOUTR programmed request ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area. .WEAK $MSARG ; Trap code for missing argument .SBTTL ITTINR,ITTOUR - Fortran-callable routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The ITTINR function transfers a character from the console ; terminal to the user program. If no characters are available, ; system action is determined by setting of bit 6 of the JSW. ; ; The ITTOUR function transfers a character from the the user ; program to the console terminal. If it is not currently possible ; to output a character, an error flag is returned. ; ; CALLING SEQUENCE: ; ; i = ITTOUR(char) ; ; i = ITTINR( ) ; ; ; OUTPUT PARAMETERS: ; ; R0 - status of transfering character ; ; RETURNED FUNCTION VALUE: ; ; ITTOUR ; 0 - Character was output ; 1 - Ring buffer is full ; ; ITTINR ; I > 0 - Character read ; I < 0 - No character available ; ; -- .PSECT SYS$I ITTINR::.TTINR ;.TTINR BCC 10$ ROR R0 ; 10$: RETURN ITTOUR:: CMPB #1,@R5 ; arg present ? BLT ERR ; no then err TST (R5)+ ; R5 -> character MOVB @(R5),R0 ; R0 cnts character .TTOUTR BIC R0,R0 ;*C* clear error flag ADC R0 ; set function result(0 or 1) RETURN ERR: TRAP $MSARG ; trap on any missing argument in call RETURN .END