Google
 

Trailing-Edge - PDP-10 Archives - KS10_APT_INSTALL_TAPE - uetp/lib/cmlbio.mac
There is 1 other file named cmlbio.mac in the archive. Click here to see a list.
;<EIBEN>CMLBIO.MAC.9,  8-Mar-78 10:43:12, Edit by F-S
;	took tstmem out of cashky -- its system-dependent
;<1EIBEN>CMLBIO.MAC.5, 25-Feb-78 16:59:42, Edit by EIBEN
;	took systes-call out of cashky
	TITLE	CMLBIO	I/O ROUTINES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.



	;THIS LIBRARY CONTAINS ROUTINES ASSOCIATED WITH I/O.

	PRGEND
	TITLE	INIV52	INITIALISE AND RESET FOR CURSOR ADDRESSING
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	INIV52,RESV52

	;ROUTINE TO INITIALISE A VT52 FOR CURSOR ADDRESSING. ENTER
	;WITH FLAG "VT52FG" NON-ZERO IF TERMINAL IS A VT52! SETS FLAG
	;"V52SET" AND SETS MODE TO ALLOW CURSOR ADDRESSING.

INIV52:	SKIPN	VT52FG##	;ARE WE VT52?
	ret			;NO
	MOVEI	T1,.PRIOU	;GET MODE
	RFMOD
	TXZ	T2,<FLD(3,TT%DAM)>
	SFMOD			;SET BINARY
	SETOM	V52SET##	;SET FLAG
	ret	

	;ROUTINE TO RESET VT52 AFTER CURSOR ADDRESSING WAS IN USE.
	;ENTER WITH FLAG "V52SET" SET IF TERMINAL IS A VT52.
	;CLEARS "V52SET" AND RESETS MODE TO NORMAL.

RESV52:	SKIPN	V52SET##	;VT52?
	ret			;NO
	call	CURBOT##	;CURSOR AT BOTTOM
	MOVEI	T1,.PRIOU
	RFMOD			;GET MODE
	TXO	T2,<FLD(1,TT%DAM)>
	SFMOD
	SETZM	V52SET##	;RESET FLAG
	CFIBF			;CLEAR INPUT BUFFER
	ret	

	PRGEND
	TITLE	SCNACR	CLEAR THE SCREEN COMPLETELY.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	SCNACR

	;ROUTINE TO CLEAR THE SCREEN OF A VT52. ENTER WITH "V52SET"
	;SET IF VT52 INITIALISED.

SCNACR:	SKIPN	V52SET##	;VT52?
	PJRST	CRLF##		;NO
	call	CURHOM##	;HOM CURSOR
	PJRST	SCNCLR##	;CLEAR

	PRGEND
	TITLE	CURBOT	PUT CURSOR AT THE BOTTOM OF THE SCREEN
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURBOT

	;ROUTINE TO PUT CURSOR AT THE BOTTOM OF THE SCREEN OF A VT52.
	;ENTER WITH "V52SET" SET IF VT52 INITIALISED.

CURBOT:	SKIPN	V52SET##	;VT52?
	PJRST	CRLF##		;NO
	call	SCNCLR##	;CLEAR SCREEN
	MOVEI	T2,27		;BOTTOM LINE
	PJRST	CURLIN##	;POSITION IT

	PRGEND
	TITLE	SCNCLR	CLEAR TO END OF SCREEN
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	SCNCLR

	;ROUTINE TO CLEAR TO THE END OF THE SCREEN OF A VT52.
	;ENTER WITH "V52SET" IF VT52 INITILAISED FOR CURSOR CONTROL.

SCNCLR:	SKIPN	V52SET##	;VT52?
	PJRST	CRLF##		;NO
	call	CURALT##	;SEND ALTMODE
	MOVEI	T2,"J"		;SEND J
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	CUREOL	DELETE TO END OF LINE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CUREOL

	;ROUTINE TO DELETE TO THE END OF THE CURRENT LINE ON A
	;VT52. ENTER WITH "V52SET" SET IF VT52 INITIALISED.

CUREOL:	SKIPN	V52SET##	;VT52?
	ret			;NO
	call	CURALT##	;SEND ALTMODE
	MOVEI	T2,"K"		;SEND K
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	CURHOM	HOME CURSOR
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURHOM

	;ROUTINE TO HOME CURSOR ON VT52 IF "V52SET" SET.

CURHOM:	SKIPN	V52SET##	;VT52?
	PJRST	CRLF##		;NO
	call	CURALT##	;SEND ALTMODE
	MOVEI	T2,"H"		;SEND H
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	CURLIN	POSITION CURSOR AT BEGINNING OF LINE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURLIN

	;ROUTINE TO POSITION CURSOR AT BEGINNING OF A LINE. ENTER
	;WITH LINE NUMBER IN T2.

CURLIN:	PUSH	P,T2		;SAVE LINE NUMBER
	call	CURDIR##	;SET FOR DIRECT ADDRESSING
	POP	P,T2		;GET LINE NUMBER
	ADDI	T2,40		;DO IT PROPERLY
	call	CHROUT##	;SEND IT
	PJRST	CURBOL##	;SET TO BEGINNING OF LINE

	PRGEND
	TITLE	CURBOL	POSITION AT BEGINNING OF LINE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURBOL

	;ROUTINE TO PLACE CURSOR AT BEGINNING OF LINE. ENTER HAVING
	;SEND ALTMODE AND LINE NUMBER.

CURBOL:	MOVEI	T2,40		;AT BEGINNING
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	CURDIR	SET UP FOR DIRECT CURSOR ADDRESSING
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURDIR

	;ROUTINE TO SET UP FOR DIRECT CURSOR ADDRESSING. SENDS
	;AN ALTMODE FOLLOWED BY A "Y".

CURDIR:	call	CURALT##	;SEND AN ALTMODE
	MOVEI	T2,"Y"		;THEN A "Y"
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	CURALT	ROUTINE TO SEND ALTMODE TO TERMINAL
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CURALT

	;ROUTINE TO SEND ALTMODE "ESCAPE" TO TERMINAL FOR CURSOR
	;ADDRESSING.

CURALT:	MOVEI	T2,33		;SEND ALTMODE
	PJRST	CHROUT##	;SEND IT

	PRGEND
	TITLE	MINSOT	PRINT MINUTES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	MINSOT

	;ROUTINE TO PRINT MINUTES WHEN PRINTING TIME.
	;ENTER WITH NUMBER OF MINUTES IN T2.

MINSOT:	MOVX	T3,<NO%LFL+NO%ZRO+FLD(2,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	TTYNOT	PRINT TTY NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	TTYNOT

	;ROUTINE TO PRINT A TTY NUMBER, ENTER WITH NUMBER IN T1.
	;EITHER PRINTS THE OCTAL NUMBER OF THE TTY OR PRINTS "DET"
	;IF THE NUMBER IS -1.

TTYNOT:	JUMPGE	T1,TTYNL1	;DETACHED?
	HRROI	T2,[ASCIZ /DET/]
	PJRST	STGOUT##	;YES

TTYNL1:	HLRZ	T2,T1		;GET NUMBER
	MOVX	T3,<NO%LFL+FLD(3,NO%COL)+FLD(10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	CASHKY	PRINT DETAILS OF CACHE AND CORE IN PICTURES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CASHKY

	;ROUTINE TO PRINT DETAILS OF CACHE AND CORE IN PICTURE.
	;PRINTS A 5 BY 5 MATRIX PICTURE OF THE FORM "20X0 YYYK"
	;WHERE "X" IS 5 IF CACHE ENABLED, OR 4 OTHERWISE, AND
	;YYY IS THE SIZE OF PHYSICAL CORE IN K.
	;DESIGNED FOR A VT52 SCREEN.

CASHKY:	SETZM	D		;MAKE POINTER
	call	CRLF##
CSHLP1:	PUSH	P,OUTP		;SAVE JFN
	HRROI	OUTP,SPACE##	;BUILD IT IN CORE FIRST
	call	SP2OUT##	;TWO SPACES
	MOVEI	T1,2		;IT'S A 20
	call	PICDIG##	;SO SAY SO
	MOVEI	T1,0		;AT LEAST THIS FAR
	call	PICDIG##	;BECAUSE ALL ARE THE SAME
	move	t1, systyp##	;get system-type
	call	PICDIG##	;TELL HIM
	MOVEI	T1,0		;FINISH OFF
	call	PICDIG##
	call	PICSPC##	;PRINT A SPACE
	move	t1,phycor##	;how much core?
	LSH	T1,-1		;MAKE K'S
	IDIVI	T1,^D100	;THIS MUCH I HOPE
	PUSH	P,T2		;SAVE REMAINDER
	call	PICDNZ##	;PRINT IT
	POP	P,T1		;GET REMAINDER
	IDIVI	T1,^D10		;TENS
	PUSH	P,T2		;SAVE REMAINDER
	call	PICDNZ##	;PRINT IT
	POP	P,T1		;GET REMAINDER
	call	PICDIG##	;PRINT IT
	call	PICLTK##	;PRINT "K"
	POP	P,OUTP		;RESTORE JFN
	HRROI	T2,SPACE##	;POINT TO LINE
	call	CALIGN##	;CENTRE ALIGN IT
	call	STGOUT##	;PRINT IT
	call	CRLF##	;NEW LINE
	AOS	D		;INCREMENT LINE
	CAIG	D,4		;DONE?
	JRST	CSHLP1		;NO
	JRST	CRLF##		;YES

	PRGEND
	TITLE	PICLTK	PRINT THE LETTER "K"
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PICLTK

	;ROUTINE TO PRINT THE LETTER K IN PICTURES

PICLTK:	MOVEI	T1,PICK##	;POINT TO MATRIX
	PJRST	PICPIC##	;PRINT IT

	PRGEND
	TITLE	PICDNZ	;PRINT DIGIT IF NON-ZERO
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PICDNZ

	;ROUTINE TO PRINT A "0" IN PICTURES IF NON-ZERO. OTHERWISE
	;PRINT A SPACE. ENTER WITH DIGIT IN T1.

PICDNZ:	JUMPE	T1,PICSPC##	;IF ZERO-PRINT SPACE
	PJRST	PICDIG##	;ELSE DIGIT

	PRGEND
	TITLE	PICDIG	PRINT DIGIT IN PICTURES
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PICDIG

	;ROUTINE TO PRINT A DIGIT IN PICTURES. ENTER WITH T1
	;CONTAINING THE DIGIT AND "D" POINTING TO THE CURRENT
	;"LINE" OF THE PICTURE.

PICDIG:	MOVE	T1,PICNUM(T1)	;GET ADDRESS OF DIGIT
	PJRST	PICPIC##	;PRINT IT

PICNUM:	PIC0##
	PIC1##
	PIC2##
	PIC3##
	PIC4##
	PIC5##
	PIC6##
	PIC7##
	PIC8##
	PIC9##

	PRGEND
	TITLE	PICPIC	PRINT A PICTURE LETTER OR DIGIT
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PICPIC,PICSPC

	;ROUTINE TO PRINT A PICTURE OF EITHER A LETTER OR A DIGIT.
	;THE CHARACTER SHOULD BE DEFINED IN TERMS OF A 5 BY 5 MATRIX
	;AND, ON ENTRY, T1 SHOULD POINT TO THIS MATRIX AND "D" SHOULD
	;POINT TO THE LINE WITHIN IT. PICSPC IS DEFINED AS AN
	;ENTRY POINT TO PRINT A SPACE.

PICPIC:	HRRZ	T2,D		;GET LINE NUMBER
	CAILE	T2,5		;IN RANGE?
	JRST	PICSPC		;NO
	ADD	T1,D		;ADD IN LINE NUMBER
	SKIPA	A,(T1)		;GET STRING
PICSPC:	MOVE	A,[ASCII /     /]
	MOVE	B,[ASCIZ /  /]	;PLUS SOME SPACES
	HRROI	T2,A		;POINT TO IT
	PJRST	STGOUT##	;PRINT IT

	PRGEND
	TITLE	PICNOS	PICTURES OF NUMBERS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PIC0,PIC1,PIC2,PIC3,PIC4,PIC5,PIC6,PIC7,PIC8,PIC9

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 0.

PIC0:	ASCII	/ 000 /
	ASCII	/0   0/
	ASCII	/0   0/
	ASCII	/0   0/
	ASCII	/ 000 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 1.

PIC1:	ASCII	/  1  /
	ASCII	/ 11  /
	ASCII	/  1  /
	ASCII	/  1  /
	ASCII	/ 111 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 2.

PIC2:	ASCII	/ 222 /
	ASCII	/2   2/
	ASCII	/  22 /
	ASCII	/ 2   /
	ASCII	/22222/

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 3.

PIC3:	ASCII	/ 333 /
	ASCII	/3   3/
	ASCII	/  33 /
	ASCII	/3   3/
	ASCII	/ 333 /

PAGE
	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 4.

PIC4:	ASCII	/   4 /
	ASCII	/  44 /
	ASCII	/ 4 4 /
	ASCII	/44444/
	ASCII	/   4 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 5.

PIC5:	ASCII	/55555/
	ASCII	/5    /
	ASCII	/5555 /
	ASCII	/    5/
	ASCII	/5555 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 6.

PIC6:	ASCII	/ 666 /
	ASCII	/6    /
	ASCII	/6666 /
	ASCII	/6   6/
	ASCII	/ 666 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 7.

PIC7:	ASCII	/77777/
	ASCII	/   7 /
	ASCII	/  7  /
	ASCII	/ 7   /
	ASCII	/7    /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 8.

PIC8:	ASCII	/ 888 /
	ASCII	/8   8/
	ASCII	/ 888 /
	ASCII	/8   8/
	ASCII	/ 888 /

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER 9.

PIC9:	ASCII	/ 999 /
	ASCII	/9   9/
	ASCII	/ 9999/
	ASCII	/    9/
	ASCII	/ 999 /

	PRGEND
	TITLE	PICK	PICTURE OF CHARACTER K
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PICK

	;A STANDARD 5 BY 5 MATRIX PICTURE OF THE CHARACTER K.

PICK:	ASCII	/K   K/
	ASCII	/K  K /
	ASCII	/KKK  /
	ASCII	/K  K /
	ASCII	/K   K/

	PRGEND
	TITLE	PNTDEV	PRINT DEVICE SPECIFICATION
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PNTDEV

	;ROUTINE TO PRINT DEVICE SPECIFICATION. ENTER WITH 
	;DEVICE ID IN T2.

PNTDEV:	call	OUTPGT##	;TO OUTPUT DEVICE
	DEVST			;SEND IT
	 call	JSERPJ##	;COULD NOT
	ret			;RETURN

	PRGEND
	TITLE	DATMOT	PRINT DATE AND TIME
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DATMOT

	;ROUTINE TO PRINT TODAY'S DATE AND TIME.

DATMOT:	SETOM	T2		;TODAY
	PJRST	DTTMPT##	;PRINT IT

	PRGEND
	TITLE	DATEOT	OUTPUT AN ACCESS DATE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DATEOT

	;ROUTINE TO OUTPUT AN ACCESS DATE. ENTER WITH DATE IN INTERNAL
	;FORMAT IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP. IF
	;T2 CONTAINS 0 "NEVER" IS OUTPUT. OTHERWISE DATE IS OUTPUT
	;IN DD-MMM-YY FORMAT.

DATEOT:	JUMPN	T2,DTONPT##	;PRINT DATE
	HRROI	T2,[ASCIZ /  NEVER  /]
	PJRST	STGOUT##	;PRINT IT

	PRGEND
	TITLE	DTONPT	PRINT THE DATE ONLY
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DTONPT

	;ROUTINE TO PRINT THE DATE ONLY. ENTER WITH DATE IN INTERNAL
	;FORMAT IN T2. PRINTS DATE TO FILE WITH JFN IN OUTP

DTONPT:	MOVX	T3,<OT%NTM>	;JUST DATE
	PJRST	JODTIM##	;PRINT IT

	PRGEND
	TITLE	DTTMPT	PRINT DATE AND TIME
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DTTMPT

	;ROUTINE TO PRINT DATE AND TIME TO FILE WITH JFN IN OUTP.
	;ENTER WITH DATE AND TIME IN INTERNAL FORMAT IN T2.

DTTMPT:	MOVX	T3,<OT%DAY+OT%NSC>
	PJRST	JODTIM##	;PRINT IT

	PRGEND
	TITLE	OTPFFS	OUTPUT FILESPEC TO FILL A SPACE.
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	OTPFFS

	;ROUTINE TO OUTPUT A FILESPEC TO FILL A SPACE. ENTER WITH
	;OUTPUT JFN IN OUTP AND FILE JFN IN T1. T2 SHOULD CONTAIN
	;FLAGS AS DESCRIBED IN "CMLBSM" OF THE S%%XXX SERIES. THE
	;RIGHT HALF OF T2 SHOULD CONTAIN THE NUMBER OF CHARACTERS
	;TO BE PRINTED.

OTPFFS:	PUSH	P,T2		;SAVE FLAGS
	PUSH	P,OUTP		;SAVE JFN FOR OUTPUT
	HRROI	OUTP,SPACE##	;WRITE FILESPEC TO CORE FIRST
	call	OTPFSP##	;WRITE IT TO CORE
	 JFCL			;IGNORE ERROR
	POP	P,OUTP		;RESTORE OUTPUT JFN
	POP	P,T3		;AND NUMBER OF CHARACTERS
	HRRZS	T3
	HRROI	T2,SPACE##	;POINT TO FILESPEC
	PJRST	OTPFLD##	;GO DO IT NICELY

	PRGEND
	TITLE	OTPFSP	OUTPUT FILESPEC IN VARYING FORMATS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	OTPFSP

	;ROUTINE TO OUTPUT FILESPEC. ENTER WITH OUTPUT JFN IN
	;"OUTP" AND FILE JFN IN T1. T2 SHOULD CONTAIN FLAGS AS DESCRIBED
	;IN "CMLBSM" PERTAINING TO THE REQUIRED FIELDS TO BE
	;PRINTED. THESE FLAGS ARE OF THE S%%XXX SERIES. 

OTPFSP:	SETZM	T3		;START WITH NOTHING
	TXNE	T2,S%%STR	;WANT STRUCTURE?
	TXO	T3,<FLD(1,JS%DEV)> ;SET FLAGS
	TXNE	T2,S%%DIR	;WANT DIRECTORY?
	TXO	T3,<FLD(1,JS%DIR)> ;SET FLAGS
	TXNE	T2,S%%NAM	;WANT NAME
	TXO	T3,<FLD(1,JS%NAM)> ;SET FLAGS
	TXNE	T2,S%%EXT	;WANT EXTENSION
	TXO	T3,<FLD(1,JS%TYP)> ;SET FLAGS
	TXNE	T2,S%%GEN	;WANT GENERATION?
	TXO	T3,<FLD(1,JS%GEN)> ;SET FLAGS
	TXNE	T2,S%%PRO	;WANT PROTECTION
	TXO	T3,<FLD(1,JS%PRO)> ;SET FLAGS
	TXNE	T2,S%%ACC	;WANT ACCOUNT?
	TXO	T3,<FLD(1,JS%ACT)> ;SET FLAGS
	TXO	T3,JS%PAF	;PUNCTUATE ALL FIELDS
	HRRZ	T2,T1		;GET JFN
	MOVE	T1,OUTP		;WHERE TO PUT IT
	JFNS			;SO WE CAN MEASURE IT
	ret			;OK

	PRGEND
	TITLE	OTPFLD	OUTPUT A STRING IN A SPECIFIED SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	OTPFLD

	;ROUTINE TO OUTPUT A STRING AND EITHER TRUNCATE OR
	;PAD WITH SPACES TO FILL A FIXED FIELD. ENTER WITH
	;OUTPUT JFN IN "OUTP" AND POINTER TO STRING IN T2
	;PLUS THE NUMBER OF CHARACTERS TO PRINT IN T3.

OTPFLD:	SETZM	T4		;END ON NULL
	call	JSOUT##	;WRITE IT
	 PJRST	JSERPJ##	;ERROR
	JUMPE	T3,CPOPJ##	;ALL DONE
	MOVNI	T3,1(T3)	;MAKE NEGATIVE
	HRROI	T2,SPCBUF##	;POINT TO SPACES
	call	JSOUT##	;PRINT THEM
	 PJRST	JSERPJ##	;PRINT ERROR
	ret			;OK

	PRGEND
	TITLE	SIXPNT	PRINT SIXBIT NAME
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	SIXPNT

	;ROUTINE TO PRINT A SIXBIT NAME. ENTER WITH NAME IN T1.
	;OUTPUT IS TO FILE WITH JFN IN "OUTP".

SIXPNT:	MOVE	T2,[440600,,T1]	;MAKE A BYTE POINTER
	MOVE	T3,[440700,,SPACE##] ;AND ONE FOR OUTPUT
SIXLP1:	ILDB	T4,T2		;GET A CHAR
	ADDI	T4,40		;ASCIFY IT
	IDPB	T4,T3		;SAVE IT
	TLNE	T2,770000	;ANY MORE?
	JRST	SIXLP1		;YES
	SETZM	T4		;MAKE ASCIZ
	IDPB	T4,T3		;TO PRINT IT
	HRROI	T2,SPACE##	;POINT TO STRING
	PJRST	STGOUT##	;PRINT IT

	PRGEND
	TITLE	PRCSP	PRINT PERCENTAGE FOLLOWED BY A SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PRCSP

	;ROUTINE TO OUTPUT A PERCENTAGE TO A FILE FOLLOWED BY A
	;SPACE. ENTER WITH VALUE IN T1 AND DIVISOR IN T2. OUTPUT
	;IS OF THE FORM XX.X GIVING ONE PLACE OF DECIMALS. OUTPUT
	;GOES TO FILE WITH JFN IN OUTP. RETURN +1 ALWAYS. 

PRCSP:	call	PRCPNT##	;PRINT IT
	PJRST	SPCOUT##	;AND A SPACE

	PRGEND
	TITLE	PRCPNT	PRINT PERCENTAGE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	PRCPNT,PRCPN1

	;ROUTINE TO PRINT A PERCENTAGE TO A FILE. ENTER WITH VALUE
	;IN T1 AND DIVISOR IN T2. OUTPUT IS OF THE FORM XX.XX AND
	;GOES TO THE FILE WITH JFN IN OUTP. RETURN +1 ALWAYS.
	;A SPECIAL ENTRY POINT (PRCPN1) IS PROVIDED FOR PRINTING A RATIO
	;(I.E. WITHOUT MULTIPLYING BY 100).

PRCPNT:	IMULI	T1,^D100	;TIMES 100 FIRST
PRCPN1:	PUSH	P,T2		;SAVE DIVISOR
	IDIV	T1,T2		;MAKE PERCENTAGE
	PUSH	P,T2		;SAVE REMAINDER
	MOVE	T2,T1		;GET FIRST PART
	call	DIG2OT##	;PRINT IT
	call	DOTOUT##	;PRINT DOT
	POP	P,T1		;GET REMAINDER
	POP	P,T2		;AND DIVISOR
	IMULI	T1,^D100	;MAKE HUNDREDTHS
	IDIV	T1,T2		;JUST HUNDREDTHS
	MOVE	T2,T1		;COPY IT
	MOVX	T3,<NO%LFL+NO%ZRO+FLD(2,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	DIG1SP	OUTPUT A ONE DIGIT NUMBER FOLLOWED BY A SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG1SP

	;ROUTINE TO PRINT A ONE DIGIT NUMBER FOLLOWED BY A SPACE.
	;ENTER WITH DECIMAL NUMBER IN T2. OUTPUT IS TO FILE WITH
	;JFN IN OUTP. RETURN +1 ALWAYS.

DIG1SP:	call	DIG1OT##	;PRINT IT
	PJRST	SPCOUT##	;AND A SPACE

	PRGEND
	TITLE	DIG2SP	OUTPUT A TWO DIGIT NUMBER FOLLOWED BY A SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG2SP

	;ROUTINE TO OUTPUT A TWO DIGIT NUMBER FOLLOWED BY A SPACE.
	;ENTER WITH DECIMAL NUMBER IN T2. OUTPUT IS TO FILE WITH
	;JFN IN OUTP. RETURN +1 ALWAYS.

DIG2SP:	call	DIG2OT##	;PRINT IT
	PJRST	SPCOUT##

	PRGEND
	TITLE	DIG3SP	OUTPUT A THREE DIGIT NUMBER FOLLOWED BY A SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG3SP

	;ROUTINE TO OUTPUT A 3 DIGIT NUMBER FOLLOWED BY A SPACE.
	;ENTER WITH DECIMAL NUMBER IN T2. OUTPUT IS TO FILE WITH
	;JFN IN OUTP. RETURN +1 ALWAYS.

DIG3SP:	call	DIG3OT##	;OUTPUT IT
	PJRST	SPCOUT##	;AND A SPACE

	PRGEND
	TITLE	DIG4SP	OUTPUT A 4 DIGIT NUMBER FOLLOWED BY A SPACE
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG4SP

	;ROUTINE TO OUTPUT A 4 DIGIT NUMBER FOLLOWED BY A SPACE.
	;ENTER WITH NUMBER IN T2. OUTPUT IS TO FILE WITH JFN IN
	;OUTP. RETURN IS +1 ALWAYS.

DIG4SP:	call	DIG4OT##	;OUTPUT NUMBER
	PJRST	SPCOUT##	;AND A SPACE

	PRGEND
	TITLE	DIG1OT	OUTPUT A ONE DIGIT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG1OT

	;ROUTINE TO OUTPUT A 1 DIGIT NUMBER. ENTER WITH NUMBER
	;IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP. RETURN +1

DIG1OT:	MOVX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(1,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	DIG2OT	OUTPUT A 2 DIGIT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG2OT

	;ROUTINE TO OUTPUT A TWO DIGIT NUMBER. ENTER WITH DECIMAL
	;NUMBER IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;RETURN +1 ALWAYS

DIG2OT:	MOVX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(2,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	DIG3OT	OUTPUT A 3 DIGIT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG3OT

	;ROUTINE TO OUTPUT A 3 DIGIT NUMBER. ENTER WITH DECIMAL
	;NUMBER IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;RETURN +1 ALWAYS.

DIG3OT:	MOVX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(3,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;OUTPUT IT

	PRGEND
	TITLE	DIG4OT	OUTPUT A 4 DIGIT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	DIG4OT

	;ROUTINE TO OUTPUT A 4 DIGIT NUMBER. ENTER WITH DECIMAL
	;NUMBER IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;RETURN +1 ALWAYS.

DIG4OT:	MOVX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(4,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

	PRGEND
	TITLE	dig5ot	OUTPUT A 5 DIGIT NUMBER
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	dig5ot

	;ROUTINE TO OUTPUT A 5 DIGIT NUMBER. ENTER WITH DECIMAL
	;NUMBER IN T2. OUTPUT IS TO FILE WITH JFN IN OUTP.
	;RETURN +1 ALWAYS.

dig5ot:	MOVX	T3,<NO%LFL+NO%AST+NO%OOV+FLD(5,NO%COL)+FLD(^D10,NO%RDX)>
	PJRST	NUMOUT##	;PRINT IT

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

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL
	ENTRY	NUMOUT

	;ROUTINE TO OUTPUT A NUMBER. ENTER WITH INTEGER NUMBER IN
	;T2 AND WITH FORMAT BITS IN T3. OUTPUT IS TO FILE WITH JFN
	;IN OUTP. RETURN +1 ALWAYS.

NUMOUT:	call	JNOUT##	;PRINT IT
	 JFCL			;IGNORE ERROR
	ret			;OK

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

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	FNUMOT

	;ROUTINE TO OUTPUT A FLOATING POINT NUMBER TO FILE WITH
	;JFN IN OUTP. ENTER WITH NUMBER IN T2 AND FLAGS SET IN
	;T3. RETURN +1 ALWAYS. PRINTS ERROR MESSAGE IF ERROR.

FNUMOT:	call	JFLOUT##	;DO IT
	 JFCL			;NO ERROR
	ret			;OK

	PRGEND
	TITLE	PNCTOT	OUTPUT PUNCTUATION CHARACTERS
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	COLOUT,COMOUT,DOTOUT,SPCOUT,TABOUT,FFOUT,CROUT
	ENTRY	LFOUT,CRLF,SP2OUT,SP3OUT

	;ROUTINE TO PRINT A COLON. OUTPUT IS TO FILE WITH JFN
	;IN OUTP.

COLOUT:	MOVEI	T2,":"		;GET IT
	PJRST	CHROUT##	;PRINT IT

	;ROUTINE TO OUTPUT A COMMA. OUTPUT IS TO FILE WITH JFN IN "OUTP"

COMOUT:	MOVEI	T2,","		;GET IT
	PJRST	CHROUT##	;PRINT IT

	;ROUTINE TO PRINT A DOT. OUTPUT IS TO FILE WITH JFN
	;IN OUTP

DOTOUT:	MOVEI	T2,"."		;GET IT
	PJRST	CHROUT##	;PRINT IT

	;ROUTINE TO OUTPUT A SPACE

SPCOUT:	MOVEI	T2," "		;SEND SPACE
	PJRST	CHROUT##	;DO IT

PAGE
	;ROUTINE TO OUTPUT A TAB

TABOUT:	MOVEI	T2,"	"	;SEND TAB
	PJRST	CHROUT##	;DO IT

	;ROUTINE TO OUTPUT A FORM-FEED

FFOUT:	MOVEI	T2,14		;SEND IT
	PJRST	CHROUT##

	;ROUTINE TO OUTPUT CR.

CROUT:	MOVEI	T2,15		;SEND JUST CR
	PJRST	CHROUT##

	;ROUTINE TO OUTPUT LF.

LFOUT:	MOVEI	T2,12		;SEND LF
	PJRST	CHROUT##	;SEND IT

	;ROUTINE TO OUTPUT CRLF

CRLF:	HRROI	T2,[ASCIZ /
/]
	PJRST	STGOUT##	;SEND IT

	;ROUTINE TO OUTPUT TWO SPACES

SP2OUT:	HRROI	T2,[ASCIZ /  /]
	PJRST	STGOUT##	;SEND IT

	;ROUTINE TO OUTPUT THREE SPACES

SP3OUT:	HRROI	T2,[ASCIZ /   /]
	PJRST	STGOUT##	;SEND IT

	PRGEND
	TITLE	STGOUT	OUTPUT A STRING OF INFINITE LENGTH
	SUBTTL	C.MITCHELL 1977. ROUTINES WRITTEN AT COLOGNE.

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	STGOUT

	;ROUTINE TO OUTPUT A STRING OF INFINITE LENGTH TO FILE WITH
	;JFN IN OUTP. ENTER WITH T2 POINTING TO THE STRING. RETURN
	;+1 ALWAYS.

STGOUT:	SETZM	T3		;INFINITE LENGTH
	call	JSOUT##	;DO IT
	 JFCL			;NO ERROR
	ret			;OK

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

	SEARCH	MONSYM,MACSYM,CMLBSM

	IFNDEF	.PSECT,<
	.DIRECT	.XTABM>

	SALL

	ENTRY	CHROUT

	;ROUTINE TO OUTPUT A CHARACTER TO FILE WITH JFN IN OUTP.
	;ENTER WITH CHARACTER IN T2. RETURN +1 ALWAYS.

CHROUT:	call	JBOUT##	;OUTPUT CHARACTER
	 JFCL			;NO ERROR
	ret			;OK

	END