Google
 

Trailing-Edge - PDP-10 Archives - KS10_APT_INSTALL_TAPE - uetp/lib/cmlbjs.mac
There is 1 other file named cmlbjs.mac in the archive. Click here to see a list.
	TITLE	CMLBJS	LIBRARY OF JSYS CALLS.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.


	;THIS LIBRARY CONTAINS "JSYS" CALLS. ALL ROUTINES BEGIN
	;WITH A "J" AND ARE FOLLOWED BY THE NAME OF THE JSYS.

	;THE IDEA IS THAT ERROR CHECKS AND MULTIPLE RESULTS
	;CAN BE CHECKED, ERROR MESSAGES ISSUED, AND MULTIPLE
	;RETURNS CAN BE PROVIDED.

	;WITH I/O JSYS'S THE JFN IS EXPECTED TO BE IN "T1".
	;ALL ROUTINES SHOULD BE WRITTEN SO THAT THE CURRENT
	;JFN FOR OUTPUT IS HELD IN "OUTP" AND THAT FOR INPUT
	;SHOULD BE IN "INP". CALLS TO SOME OF THE JSYS'S WILL
	;THEN CAUSE "T1" TO BE LOADED FROM EITHER "OUTP" OR
	;"INP". ALSO, THE UPDATED JFN WILL BE STORED BACK INTO
	;EITHER "OUTP" OR "INP" AFTER THE JSYS HAS BEEN EXECUTED.
	;THIS ALLOWS THE SAME ROUTINES TO WORK WHEN WRITING TO
	;CORE INSTEAD OF FILES.

	PRGEND
	TITLE	JCOMND	COMMAND JSYS ROUTINE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JCOMND

	;ROUTINE TO ISSUE "COMND" JSYS. ENTER WITH T2 SET UP.
	;RETURNS NON-SKIP IF A RE-PARSE IS NECESSARY, SKIP
	;IF BAD REPLY, OR DOUBLE SKIP IF GOOD.

JCOMND:	MOVEI	T1,CMDBLK##	;POINT TO COMMAND BLOCK
	COMND			;DO REQUESTED FUNCTION
	TXNE	T1,CM%RPT	;REPARSE?
	POPJ	P,		;YES--NON SKIP
	TXNN	T1,CM%NOP	;GOOD REPLY?
	PJRST	CPOPJ2##	;YES
	PJRST	CPOPJ1##	;ELSE SKIP

	PRGEND
	TITLE	JOPENF	OPEN FILE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JOPENF

	;ROUTINE TO OPEN FILE. ENTER WITH T1 CONTAINING JFN,
	;AND T2 CONTAINING OPEN FLAGS. RETURN +1 IF ERROR
	;OR SKIP IF OK. PRINT ERROR MESSAGE IF ERROR.

JOPENF:	OPENF			;OPEN IT
	 PJRST	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JGETAB	ROUTINE TO DO GETABS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JGETAB

	;ROUTINE TO DO GETABS. ENTER WITH T1 SET UP AS DEFINED
	;FOR GETABS. RETURN +1 ALWAYS WITH EITHER THE REQUIRED
	;ENTRY OR ZERO.

JGETAB:	GETAB			;GET IT
	 SETZM	T1		;NOT THERE
	POPJ	P,		;OK

	PRGEND
	TITLE	JODTIM	OUTPUT DATE AND/OR TIME
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JODTIM

	;ROUTINE TO OUTPUT THE DATE AND/OR TIME. ENTER WITH TIME IN
	;INTERNAL FORMAT IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;T3 SHOULD HAVE FLAGS SET UP.
	;RETURN +1 ALWAYS.

JODTIM:	PUSHJ	P,OUTPGT##	;OUTPUT JFN
	ODTIM			;OK
	 ERJMP	JSERPJ##	;ERROR
	POPJ	P,		;OK

	PRGEND
	TITLE	JFLOUT	OUTPUT FLOATING POINT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JFLOUT

	;ROUTINE TO OUTPUT A FLOATING POINT NUMBER IN T2 TO
	;FILE WITH JFN IN OUTP. T3 SHOULD BE SET UP. RETURN +1
	;IF ERROR, AND SKIP IF OK.

JFLOUT:	PUSHJ	P,OUTPGT##	;OUTPUT JFN
	FLOUT			;OUTPUT IT
	 PJRST	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JFLIN	INPUT A FLOATING POINT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JFLIN

	;ROUTINE TO INPUT A FLOATING POINT NUMBER IN T2 FROM
	;FILE WITH JFN IN INP. RETURN +1
	;IF ERROR, AND SKIP IF OK.

JFLIN:	PUSHJ	P,INPGT##	;INPUT JFN
	FLIN			;INPUT IT
	 PJRST	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JNOUT	OUTPUT A NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JNOUT

	;ROUTINE TO OUTPUT A NUMBER. ENTER WITH NUMBER IN T2 AND
	;FORMAT BITS IN T3. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;RETURN +1 IF ERROR, OR SKIP IF OK.

JNOUT:	PUSHJ	P,OUTPGT##	;GET JFN
	NOUT			;OUTPUT IT
	 PJRST	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;SKIP--OK

	PRGEND
	TITLE	JNIN	INPUT A NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JNIN

	;ROUTINE TO INPUT A NUMBER FROM FILE WITH JFN IN "INP".
	;T3 SHOULD BE SET UP. RETURN +1 IF ERROR OR SKIP IF OK.

JNIN:	PUSHJ	P,INPGT##	;GET JFN
	NIN			;GET NUMBER
	 POPJ	P,		;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JBKJFN	BACKUP FILE POINTER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JBKJFN

	;ROUTINE TO BACKUP INPUT FILE POINTER BY ONE BYTE.

JBKJFN:	PUSHJ	P,INPGT##	;GET JFN
	BKJFN			;DO IT
	 PJRST	JSERPJ##	;FAILED
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JBOUT	OUTPUT A CHARACTER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JBOUT

	;ROUTINE TO OUTPUT A BYTE. ENTER WITH BYTE IN T2. OUTPUT
	;IS TO FILE WITH JFN IN "OUTP". RETURN +1 IF ERROR, SKIP IF OK

JBOUT:	PUSHJ P,OUTPGT##	;GET JFN
	BOUT
	ERJMP	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JBIN	INPUT A CHARACTER FROM FILE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JBIN

	;ROUTINE TO INPUT A CHARACTER FROM A FILE. ENTER WITH
	;JFN IN "INP". RETURNS NON-SKIP IF EOF OR ERROR, OR SKIP WITH
	;BYTE IN T2.

JBIN:	PUSHJ	P,INPGT##	;GET JFN
	BIN			;GET CHAR
	ERJMP	CPOPJ##		;ERROR
	JRST	CPOPJ1##	;SKIP FOR OK

	PRGEND
	TITLE	JSOUT	OUTPUT A STRING
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JSOUT

	;ROUTINE TO OUTPUT A STRING. ENTER WITH OUTPUT JFN IN OUTP
	;AND T2 POINTING TO STRING. ALSO T3 AND T4 SHOULD BE SET UP.
	;RETURN +1 IF ERROR, OR SKIP IF OK.

JSOUT:	PUSHJ P,OUTPGT##	;GET JFN
	SOUT			;OUTPUT IT
	ERJMP	JSERPJ##	;ERROR
	PJRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JSIN	INPUT A STRING FROM A FILE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JSIN

	;ROUTINE TO INPUT A STRING. ENTER WITH JFN IN "INP" AND
	;POINTER TO SPACE FOR STRING IN T2. ALSO T3 AND T4 SHOULD
	;BE SET FOR REQUIRED LENGTH OR TERMINATING CHARACTER.
	;RETURNS +1 IF ERROR, OR SKIP IF OK.

JSIN:	PUSHJ	P,INPGT##	;GET JFN
	SIN
	ERJMP	CPOPJ##		;ERROR
	JRST	CPOPJ1##	;OK

	PRGEND
	TITLE	JSERPJ	PRINT REASON FOR JSYS ERROR
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	JSERPJ

	;ROUTINE TO PRINT REASON FOR JSYS ERROR. CALL WITH PUSHJ.

JSERPJ:	MOVEI	T1,.PRIOU	;TO TTY
	HRLOI	T2,.FHSLF	;LAST ERROR MADE BY US
	SETZM	T3		;LONG STRING
	ERSTR			;TYPE IT
	 JFCL
	 JFCL			;MANY RETURNS
	HRROI	T1,[ASCIZ /
/]
	PSOUT
	POPJ	P,		;OK

	END