Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-07 - 43,50446/io.mac
There are 60 other files named io.mac in the archive. Click here to see a list.
	TITLE	IO - GT40 BYTE I/O ROUTINES
	ENTRY	GETCHR,SNDCHR,SETTTY,CLRTTY
	;
	; THESE ROUTINES ARE FORTRAN-10 AND F40 COMPATIBLE
	; REGISTER DEFINITIONS
	;
RESULT=0
TEMP=1
L=16
P=17
	;
	; GETCHR, CALLING SEQUENCE IS:
	;
	; ICHAR = GETCHR(0)
	;
	; WHERE GETCHR IS AN INTEGER FUNCTION
	; WHICH INPUTS AN ASCII CHARACTER
	; IF THERE IS NO INPUT CHARACTER THEN
	; GETCHR RETURNS A -1
	;
GETCHR:	SKIPA			; F40 AND
	PUSH	P,L		; FORTRAN-10 COMPATIBLE
	INCHRS	RESULT,		; GET CHAR, SKIP IF GOOD
	SETO	RESULT,		; ELSE INDICATE NO CHARACTER
	POPJ	P,		; RETURN TO FORTRAN
	PAGE
	; SNDCHR, CALLING SEQUENCE:
	;
	; CALL SNDCHR(ICHAR)
	;
	; SEND ICHAR AS AN IMAGE CHARACTER
	;
SNDCHR:	SKIPA			; F40 AND
	PUSH	P,L		; FORTRAN-10 COMPATIBLE
	IONEOU	@0(L)		; SEND THE CHARACTER
	POPJ	P,		; RETURN TO FORTRAN
	PAGE
	; SETTTY IS A FORTRAN CALLABLE SUBROUTINE USED TO SET
	; TERMINAL CHARACTERISTICS NEEDED BY GIDUS-DISLIB I/O
	; ROUTINES. THE GT40 IS SET IN THE FOLLOWING MANNER:
	;
	; .SET TTY LC
	; .SET TTY NO ECHO
	; .SET TTY NO CRLF   (N.B. NOT RESET BY SUBROUTINE CLRTTY)
	;                    (WILL BE RESET BY PROGRAM CLRTTY)
	; .SET TTY NO ALTMODE
	; .SET TTY GAG
	;
	; THE SUBROUTINE CLRTTY IS USED TO CLEAR THE ABOVE
	; CONDITIONS
	;
ARGLST=1
	;
TTYFNC:	EXP	0			; SET FUNCTION CODE
	EXP	200001			; TTY1 UDX
TTYPAR:	EXP	0			; FUNCTION PARAMETER
	;
SETTTY:	SKIPA				; FORTRAN-10 AND
	PUSH	P,L			; F40 COMPATIBLE
	JSP	ARGLST,TTY
	EXP	2003,0			; .SET TTY LC
	;
	JSP	ARGLST,TTY
	EXP	2007,1			; .SET TTY NO ECHO
	;
	JSP	ARGLST,TTY
	EXP	2010,1			; .SET TTY NO CRLF
	;
	JSP	ARGLST,TTY
	EXP	2026,1			; .SET TTY NO ALTMODE
	;
	JSP	ARGLST,TTY
	EXP	2013,0			; .SET TTY GAG
	;
	POPJ	P,			; RETURN TO FORTRAN
	;
	;
CLRTTY:	SKIPA				; FORTRAN-10 AND
	PUSH	P,L			; F40 COMPATIBLE
	JSP	ARGLST,TTY
	EXP	2003,1			; .SET TTY NO LC
	;
	JSP	ARGLST,TTY
	EXP	2007,0			; .SET TTY ECHO
	;
	JSP	ARGLST,TTY
	EXP	2026,0			; .SET TTY ALTMODE
	;
	JSP	ARGLST,TTY
	EXP	2013,1			; .SET TTY NO GAG
	;
	POPJ	P,			; RETURN TO FORTRAN
	PAGE
TTY:	MOVE	RESULT,@ARGLST		; GET FUNCTION CODE
	MOVEM	RESULT,TTYFNC		; AND SETUP
	MOVE	RESULT,1(ARGLST)	; GET FUNCTION PARAMETER
	MOVEM	RESULT,TTYPAR		; AND SET UP
	MOVE	RESULT,[XWD 3,TTYFNC]	; SET UP FOR UUO CALL
	TRMOP.	RESULT,			; DO IT
	SKIP				; NO ERROR RETURN
	JRSTF	2(ARGLST)		; RETURN
	END