Google
 

Trailing-Edge - PDP-10 Archives - BB-T573C-DD_1986 - 10,7/switou.mac
There are 4 other files named switou.mac in the archive. Click here to see a list.
	TITLE	.TOUTS -- SUBROUTINES FOR OUTPUT
	SUBTTL

	SEARCH	SWIDEF,	SWIL		;SWIL PACKAGE DEFINTIONS
	SEARCH	JOBDAT,	MACTEN,	UUOSYM	;STANDARD DEFINITIONS

	SALL				;PRETTY LISTINGS
	.DIREC	FLBLST			;PRETTIER LISTINGS

	TWOSEG	400000			;NICE PURE CODE


	COMMENT	\

COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  ALL RIGHTS RESERVED.


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND 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.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
CORPORATION.

DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

\
	SUBTTL	Version and Revision History

MAJVER==13	;MAJOR VERSION LEVEL
MINVER==0	;MINOR (MAINTENANCE RELEASE) LEVEL
CSTVER==0	;CUSTOMER VERSION (WHO LAST . . .)
EDTVER==1033	;EDIT LEVEL

%%TOUT==:<BYTE (3)CSTVER(9)MAJVER(6)MINVER(18)EDTVER>
%%SWIL==:%%SWIL	;SHOW (AND SYNCHRONIZE) SWIL VERSION

IF2,<	PURGE	CSTVER,MAJVER,MINVER,EDTVER>



;INITIAL CREATION

;1000	RDH	01-Jan-84
;	Incorporate into SWIL %12(1000), sync edit level at 1000.

;1006	RDH
;	Run in non-zero PC sections.

;1022	LEO	09-Sep-85
;	Do Copyrights.

;1033	RDH	27-DEC-85
;	"+" types out wrong in .TOFSB, treat like ","

;ENTRY POINTS

	ENTRY	.TYOCH


;.TYOCH -- INITIALIZE TYPEOUT ROUTINE
;CALL:	MOVEI	T1,ADDR. OF ROUTINE
;	PUSHJ	P,.TYOCH
;RETURNS PREVIOUS ADDR. IN T1

.TYOCH::EXCH	T1,TYPOUT	;SWAP ADDR.
	POPJ	P,
;.TOLEB -- TYPE ENTER/LOOKUP BLOCK
;CALL:	1/ ADDRESS OF OPEN BLOCK
;	2/ ADDRESS OF EXTENDED LOOKUP/ENTER BLOCK
;	PUSHJ	P,.TOLEB
;USES T1-4

.TOLEB::PUSHJ	P,.SAVE1##	;NEED A PRESERVED AC
	MOVE	P1,T2		;SAVE LOOKUP BLOCK ADDRESS
	SKIPN	T1,.OPDEV(T1)	;GET DEVICE
	JRST	TOLEB1		;NO DEVICE, IGNORE IT
	PUSHJ	P,.TSIXN	;ISSUE IT
	PUSHJ	P,.TCOLN	;ISSUE SEPARATOR
TOLEB1:	MOVEI	T1,.RBPPN(P1)	;ADDRESS OF PPN/PATH BLOCK POINTER
	SKIPE	0(T1)		;GOT A PPN/PATH POINTER?
	PUSHJ	P,.TDIRB	;TYPE OUT DIRECTORY
TOLEB4:	SKIPN	T1,.RBNAM(P1)	;GET FILE NAME
	JRST	TOLEB6		;SKIP THE FILE NAME
	HLRZ	T2,.RBEXT(P1)	;GET EXTENSION
	CAIN	T2,'UFD'	;SEE IF UFD
	JUMPG	T1,[PUSHJ P,.TPPNW ;YES--TYPE AS P,PN UNLESS NAME FORMAT
		    JRST  .+2] ;PROCEED
	PUSHJ	P,.TSIXN	;ELSE ISSUE IN SIXBIT
TOLEB6:	HLLZ	T1,.RBEXT(P1)	;PEEK AHEAD AT THE EXTENSION
	JUMPE	T1,.POPJ	;JUST EXIT IF NO FILE TYPE
	PUSHJ	P,.TDOT		;TYPE DOT
	HLLZ	T1,.RBEXT(P1)	;GET EXTENSION
	PJRST	.TSIXN		;CAP OFF WITH FILE EXTENSION
;.TFBLK -- TYPE SCANER STYLE FILE BLOCK
;.TOFSB -- TYPE SCANER-STYLE FILE BLOCK, WITH EXTENSIONS
;CALL:	MOVEI	T1,ADDR OF BLOCK
;	MOVX	T2,FLAGS,,LENGTH;.TOFSB ONLY
;	PUSHJ	P,.TFBLK/.TOFSB
;
;WHERE "ADDR" IS THE ADDRESS OF THE [FIRST] FILE SPEC BLOCK;
;"FLAGS" ARE:
;	FX.UND		TYPE NODE NAME
;	FX.UDV		TYPE DEVICE NAME
;	FX.UDR		TYPE DIRECTORY NAME
;	FX.UNM		TYPE FILE NAME
;	FX.UEX		TYPE FILE EXTENSION/TYPE
;	FX.UGN		TYPE FILE GENERATION
;	FX.UFS		TYPE FILE CONSTRAINT SWITCHES
;	FX.SND		CONVERT "-" TO "_" (E.G., FOR VAXEN)
;	FX.SGN		PREFIX GENERATION WITH ";"
;"LENGTH" IS LENGTH OF FILE SPEC BLOCK FOR CONCATENATED FILE SPECS
;(IF 0 THEN NO CONCATENATED FILE SPEC BLOCKS WILL BE TYPED).
;
;USES T1-4

.TFBLK::MOVX	T2,<FX.UND!FX.UDV!FX.UDR!FX.UNM!FX.UEX!FX.UGN>
.TOFSB::PUSHJ	P,.SAVE4##	;NEED SOME PROTECTED ACS
	DMOVE	P1,T1		;SAVE FILE SPEC BLOCK ADDRESS AND FLAGS
TOFSB0:	TXNE	P2,FX.UND	;WANT NODE NAME TYPED?
	SKIPN	T1,.FSNOD(P1)	;YES, FETCH NODE NAME, IF ANY
	JRST	TOFSB1		;NO NODE NAME OUTPUT
	PUSHJ	P,TOFSTR	;TYPE NAME
	PUSHJ	P,.TCOLN	;TYPE SEPARATING ":"
	PUSHJ	P,.TCOLN	;TYPE SEPARATING "::"
TOFSB1:	TXNE	P2,FX.UDV	;WANT DEVICE NAME TYPED?
	SKIPN	T1,.FSDEV(P1)	;YES, PICK UP DEVICE (IF ANY)
	JRST	TOFSB2		;NO DEVICE NAME OUTPUT
	PUSHJ	P,TOFSTR	;TYPE DEVICE
	PUSHJ	P,.TCOLN	;TYPE COLON
TOFSB2:	TXNE	P2,FX.UDR	;WANT DIRECTORY NAME TYPED?
	SKIPN	.FSDIR(P1)	;YES, SEE IF DIRECTORY NAME
	JRST	TOFSB4		;NO DIRECTORY NAME OUTPUT
	PUSHJ	P,.TLBRK	;ISSUE OPENING LEFT BRACKET
	MOVE	T1,.FSDIR(P1)	;ADDRESS OF DIRECTORY NAME STRING
	PUSHJ	P,TOFSTR	;TYPE DIRECTORY NAME
	PUSHJ	P,.TRBRK	;ISSUE CLOSING RIGHT BRACKET

;CONTINUED ON NEXT PAGE
;CONTINUED FROM PREVIOUS PAGE

TOFSB4:	TXNE	P2,FX.UNM	;WANT FILE NAME TYPED?
	SKIPN	T1,.FSNAM(P1)	;YES, GET FILE NAME (IF ANY)
	JRST	TOFSB5		;NO FILE NAME OUTPUT
	PUSHJ	P,TOFSTR	;TYPE OUT FILE NAME
TOFSB5:	TXNE	P2,FX.UEX	;WANT FILE EXTENSION TYPED?
	SKIPN	.FSEXT(P1)	;GOT AN EXTENSION?
	JRST	TOFSB6		;NO EXTENSION OUTPUT
	PUSHJ	P,.TDOT		;TYPE A "."
	MOVE	T1,.FSEXT(P1)	;RETRIEVE FILE EXTENSION
	PUSHJ	P,TOFSTR	; TYPE IT IF NON-BLANK
TOFSB6:	TXNE	P2,FX.UGN	;WANT FILE GENERATION TYPED?
	SKIPN	.FSGEN(P1)	;GOT A GENERATION FIELD?
	JRST	TOFSB7		;NO GENERATION FIELD
	MOVEI	T1,"."		;ASSUME A DOT
	TXNE	P2,FX.SGN	;WANT SEMICOLON INSTEAD?
	MOVEI	T1,";"		;YES
	PUSHJ	P,.TCHAR	;ISSUE GENERATION SEPARATOR
	MOVE	T1,.FSGEN(P1)	;GET FILE GENERATION STRING
	PUSHJ	P,TOFSTR	;AND TYPE IT OUT
TOFSB7:	TXNN	P2,FX.UFS	;WANT SWITCH CONSTRAINTS TYPED TOO?
	JRST	TOFSW9		;NO, SKIP TO CHECK FOR CONCATENATION TYPEOUT

;CONTINUED ON NEXT PAGE
;CONTINUED FROM PREVIOUS PAGE

;TYPE OUT THE SWITCHES TOO!

TOFSW0:	MOVSI	P4,-TOFSWL	;LENGTH OF SWITCH TABLE TABLE
TOFSW1:	SETO	T1,		;THE "NO-VALUE" VALUE
	CAMN	T1,@TOFSWI(P4)	;IS THIS SWITCH PRESENT?
	JRST	TOFSW4		;NO
	PUSHJ	P,.TSLAS	;YES, START THE SWITCH WITH A "/"
	MOVE	T1,TOFSWN(P4)	;GET THE SWITCH NAME
	PUSHJ	P,.TSIXN	;AND TYPE THAT OUT NEXT
	PUSHJ	P,.TCOLN	;INDICATE A VALUE IS COMING UP
	MOVE	T1,@TOFSWI(P4)	;GET THE SPECIFIED SWITCH VALUE
	PUSHJ	P,@TOFSWT(P4)	;AND TYPE IT OUT TOO
TOFSW4:	AOBJN	P4,TOFSW1	;LOOP FOR ALL VALUE SWITCHES
TOFSW9:	TRNN	P2,-1		;GOT LENGTH OF FSB?
	POPJ	P,		;NO, ALL DONE (NO CONCATENATED SPECS)
	LDB	T1,[POINTR .FXMOD(P1),FX.TRM]  ;FETCH FILE SPEC TERMINATOR
	JUMPE	T1,.POPJ	;ALL DONE IF ","
	CAIN	T1,.FXTRC	;IF "+" OPERATOR,
	POPJ	P,		;THEN TREAT LIKE "," (I.E., ALL DONE HERE)
	PUSHJ	P,.TSPAC	;A SPACE FOR NEATNESS
	LDB	T1,[POINTR .FXMOD(P1),FX.TRM]  ;FETCH FILE SPEC TERMINATOR
	ADDI	T1,.CHGWD	;TURN IT INTO OPERATOR META-CHARACTER
	PUSHJ	P,.TFCHR	;TYPE OUT THE FILE EXPRESSION OPERATOR
	PUSHJ	P,.TSPAC	;AND ANOTHER SPACE FOR NEATNESS
	ADDI	P1,(P2)		;ADVANCE FILE SPEC POINTER
	JRST	TOFSB0		;BACK AND TYPE THE NEXT FILE SPEC BLOCK TOO


;HELPER TO TYPE OUT NAME STRINGS

TOFSTR:	HRLI	T1,(POINT 7,)	;MAKE ADDRESS INTO BYTE POINTER
	PUSH	P,T1		;PROTECT BYTE POINTER
	CAIA			;ENTER LOOP
	PUSHJ	P,TOFSTS	;TYPE SINGLE CHARACTER
	ILDB	T1,0(P)		;FETCH NEXT NAME CHARACTER
	JUMPN	T1,.-2		;LOOP TILL END OF STRING
	JRST	TPOPJ		;ADJUST STACK AND RETURN

TOFSTS:	TXNE	P2,FX.SND	;WANT "-" CONVERTED TO "_"??
	CAIE	T1,"-"		;YES, NEED TO CONVERT?
	PJRST	.TCHAR		;OUTPUT CHARACTER STRAIGHT
	MOVEI	T1,"_"		;CONVERT TO UNDERSCORE
	PJRST	.TCHAR		;OUTPUT CONVERTED CHARACTER


;HELPER TO TYPE OUT /LENGTH:MIN:MAX

TFSWLN:	PUSHJ	P,.TBLOK	;TYPE OUT FIRST (MINIMUM) VALUE
	MOVE	T1,.FXFLM(P1)	;GET SECOND (MAXIMUM) VALUE
	AOJE	T1,.POPJ	;IF BLANK, JUST OMIT IT
	PUSHJ	P,.TCOLN	;PREFACE SECOND VALUE FIELD
	MOVE	T1,.FXFLM(P1)	;RETRIEVE MAXIMUM VALUE AGAIN
	PJRST	.TBLOK		;AND TYPE IT OUT TOO
;SWITCH TABLES FOR TOFSB/TOFSW

DEFINE	DOTFSW,<
X	BEFORE,	.FXBFR,	.TDTTM
X	SINCE,	.FXSNC,	.TDTTM
X	ABEFOR,	.FXABF,	.TDTTM
X	ASINCE,	.FXASN,	.TDTTM
X	PBEFOR,	.FXPBF,	.TDTTM
X	PSINCE,	.FXPSN,	.TDTTM
X	LENGTH,	.FXFLI,	TFSWLN
X	ESTIMA,	.FXEST,	.TBLOK
X	VERSIO,	.FXVER,	.TVERW
> ;END OF DOTFSW MACTO



;THE SWITCH INDICES (ASSUME P1 POINTS TO THE FILE SPEC BLOCK)

DEFINE	X(NAM,IDX,RTN),<1B0 IDX(P1)>

TOFSWI:	DOTFSW



;THE SWITCH NAMES

DEFINE	X(NAM,IDX,RTN),<SIXBIT\NAM\>

TOFSWN:	DOTFSW



;THE SWITCH TYPERS

DEFINE	X(NAM,IDX,RTN),<1B0 RTN>

TOFSWT:	DOTFSW

	TOFSWL==.-TOFSWT
;.TDIRB -- TYPE A DIRECTORY BLOCK
;CALL:	MOVEI	T1,ADDRESS OF DIRECTORY WORD OR PATH OR BIWORDS
;	TLO	T1,0 FOR WORD, 1 FOR PATH, 2 FOR BIWORDS
;	PUSHJ	P,.TDIRB
;
;IF NAME FORMAT IS USED (I.E., "PPN" IS NAME, NOT PROJECT,PROGRAMMER)
;THEN DIRECTORY WILL BE TYPED USING "." RATHER THAN "," ON THE RATHER
;LOOSE ASSUMPTION THAT THE FILE SPEC IS TOPS-20 RATHER THAN TOPS-10.
;USES T1-4

.TDIRB::PUSHJ	P,.SAVE4##	;USE P1 AS COMMA/DOT FLAG
	SETZ	P1,		;ASSUME COMMAS

IFE FT$SFD,<
	SKIPE	T1,(T1)		;SEE IF SOMETHING
	PJRST	.TPPNW		;YES--PRINT IT
	POPJ	P,
>

IFN FT$SFD,<
	TLNE	T1,-1		;STRAIGHT (UNQUALIFIED) ADDRESS?
	JRST	TDIRB2		;NO, EITHER PATH OR BIWORDS
	SKIPN	T3,0(T1)	;YES, GET PPN OR PATH POINTER
	POPJ	P,		;NO DIRECTORY, NO TYPEOUT
	TLNE	T3,-1		;PPN OR ADDRESS OF PATH BLOCK?
	JRST	TDIRB2		;PPN, USE STRAIGHT ADDRESS
	MOVEI	T1,.PTPPN(T3)	;PATH BLOCK, POSITION NEW ADDRESS
	HRLI	T1,1		;INDICATE A PATH BLOCK ADDRESS
TDIRB2:	HLRZ	T2,T1		;GET ADDRESS TYPE (PPN, PATH BLOCK, BIWORDS)
	SKIPN	0(T1)		;GOT A DIRECTORY TO TYPE?
	POPJ	P,		;NO
	HRRZ	P4,T1		;POSITION FIRST WORD ADDRESS
	CAIE	T2,0		;IF PATH OR BIWORD FORMAT
	HRLI	P4,-.FXLND	;SET [MAXIMUM] DIRECTORY LENGTH
	SUBI	T2,1		;SET FLAG -1:PPN; 0:PATH; 1:BIWORDS
	MOVE	P3,T2		;SAVE FOR LATER TESTING
	MOVEI	T1,"["		;OUTPUT BREAK
	PUSHJ	P,.TCHAR	; ..
	MOVE	T1,0(P4)	;GET UFD
	CAME	T1,[-1]		;UNLESS -1 OR POSITIVE, USE SIXBIT
	JUMPL	T1,[PUSHJ P,.TSIXN	;TYPE OUT NAME RATHER THAN PPN
		SETO	P1,		;FLAG WANTING DOTS
		JRST	TDIRB4]		;SEE IF ANY SFD'S
	JUMPG	P3,[MOVE T2,1(P4)	;GET MASK
		PUSHJ	P,.TXWWW	;OUTPUT MASKED OCTAL XWD
		JRST	TDIRB4]		;AND PROCEED
	PUSHJ	P,.TXWDW	;TYPE OCTAL HALFWORDS (PPN)
TDIRB4:	AOBJP	P4,TDIRB8	;LOOP UNTIL DONE
	ADD	P4,P3		;OFFSET IF BIWORD INDEXING
	SKIPN	0(P4)		;HIT END OF DIRECTORY PATH YET?
	JRST	TDIRB8		;YES--RETURN TYPING LAST BREAK
	SKIPN	T1,P1		;WANT COMMA OR DOT AS SEPARATOR?
	TROA	T1,","		;COMMA
	MOVEI	T1,"."		;DOT
	PUSHJ	P,.TCHAR	;SEPARATE DIRECTORY NAME ELEMENTS
	MOVE	T1,0(P4)	;GET SFD NAME
	PUSHJ	P,.TSIXN	;TYPE IT
	JRST	TDIRB4		; AND LOOP UNTIL DONE
TDIRB8:	PJRST	.TRBRK		;AND FINISH UP
>
;.TXWWW -- TYPE A MASKED (WILD) OCTAL WORD IN XWD FORMAT
;CALL:	MOVE	T1,WORD
;	MOVE	T2,MASK
;	PUSHJ	P,.TXWWW
;USES T1-3

.TXWWW::MOVSS	T2		;T1,T2=LH(V),RH(V),RH(M),LH(M)
	ROTC	T1,-^D18	;T1,T2=LH(M),LH(V),RH(V),RH(M)
	PUSH	P,T2		;SAVE SECOND HALF (V,,M)
	MOVSS	T1		;T1=LH  V,,M
	PUSHJ	P,.TMOHW	;TYPE MASKED OCTAL HALF-WORD
	PUSHJ	P,.TCOMA	;TYPE COMMA
	POP	P,T1		;RESTORE RH  V,,M
				;FALL INTO .TMOHW

;.TMOHW -- TYPE MASKED OCTAL HALF-WORD
;CALL:	MOVE	T1,[VALUE,,MASK]
;	PUSHJ	P,.TMOHW
;USES T1-3

.TMOHW::TRCN	T1,-1		;MAKE MASK BIT 0 IF NOT WILD
	PJRST	.TASTR		;TYPE * IF ALL WILD
	MOVE	T2,T1		;MOVE TO CONVENIENT PLACE
	MOVEI	T3,6		;SET LOOP COUNT
TMOHW1:	MOVEI	T1,0		;CLEAR ACCUMULATOR
	LSHC	T1,3		;POSITION FIRST DIGIT
	JUMPN	T1,TMOHW3	;GO IF NON-ZERO
	SOJG	T3,TMOHW1	;LOOP UNTIL ALL DONE
TMOHW2:	MOVEI	T1,0		;CLEAR ACCUMULATOR
	LSHC	T1,3		;GET NEXT DIGIT
TMOHW3:	ADDI	T1,"0"		;CONVERT TO ASCII
	TLNE	T2,7		;CHECK MASK
	MOVEI	T1,"?"		;CHANGE TO ? IF WILD
	PUSHJ	P,.TCHAR	;TYPE CHARACTER
	SOJG	T3,TMOHW2	;LOOP UNTIL DONE
	POPJ	P,		;RETURN
;.TDTTM -- TYPE DATE AND TIME IN UNIVERSAL FORMAT
;CALL:	T1/ DATE-TIME IN INTERNAL FORMAT
;	PUSHJ	P,.TDTTM
;USES T1-4

.TDTTM::PUSHJ	P,.CNTDT##	;TAKE APART
;**;[574] Insert @ .TDTTM+1L	JNG	4-May-76
	ADDI	T1,^D500	;[574] ROUND TO SECOND FOR PRINTING
	CAMG	T1,[^D24*^D60*^D60*^D1000]	;[574] PAST MIDNIGHT?
	JRST	TDTTM1		;[574] NO, NORMAL CASE
	ADDI	T2,1		;[574] WAS 23:59:59.835, BUMP DAY
	SUB	T1,[^D24*^D60*^D60*^D1000]	;[574] MAKE TIME 0:0:0
TDTTM1:	PUSH	P,T1		;[574] SAVE TIME
	MOVE	T1,T2		;POSITION DATE
	PUSHJ	P,.TDATE	;TYPE DATE
	PUSHJ	P,.TCOLN	;TYPE COLON
	POP	P,T1		;RESTORE TIME
	PJRST	.TTIME		;TYPE TIME AND RETURN


;.TDATN -- TYPE TODAY'S DATE IN STANDARD FORMAT
;.TDATE -- TYPE DATE IN STANDARD FORMAT OF DD-MMM-YY
;CALL:	MOVEI	T1,DATE IN SYSTEM FORMAT FROM DATE UUO
;	PUSHJ	P,.TDATE/.TDATN
;USES T1-4

.TDATN::DATE	T1,		;GET TODAY'S DATE

.TDATE::PUSHJ	P,.SAVE1##	;SAVE P1
	IDIVI	T1,^D31		;GET DAYS
	MOVE	T4,T1		;SAVE REST
	MOVEI	T1,1(T2)	;GET DAYS AS 1-31
	PUSHJ	P,TDEC2Z	;TYPE IN DECIMAL
	IDIVI	T4,^D12		;GET MONTHS
	MOVEI	T1,[ASCIZ /-Jan/
		    ASCIZ /-Feb/
		    ASCIZ /-Mar/
		    ASCIZ /-Apr/
		    ASCIZ /-May/
		    ASCIZ /-Jun/
		    ASCIZ /-Jul/
		    ASCIZ /-Aug/
		    ASCIZ /-Sep/
		    ASCIZ /-Oct/
		    ASCIZ /-Nov/
		    ASCIZ /-Dec/](P1)	;GET ASCII
	PUSHJ	P,.TSTRG	;TYPE IT
	MOVEI	T1,^D64(T4)	;GET YEAR SINCE 1900
	IDIVI	T1,^D100	;GET JUST YEARS IN CENTURY	[257]
	MOVN	T1,T2		;NEGATE TO GET - SIGN		[257]
	PJRST	.TDECW		;TYPE IT AND RETURN
;.TTIMN -- TYPE CURRENT TIME IN STANDARD FORMAT
;.TTIME -- TYPE TIME IN STANDARD FORMAT OF HH:MM:SS
;CALL:	MOVEI	T1,TIME IS MILLISEC SINCE MIDNIGHT
;	PUSHJ	P,.TTIME/.TTIMN
;USES T1-4

;WARNING: THIS ROUTINE TRUNCATES THE TIME; IT WILL PRINT 15:59:59.995
;	AS 15:59:59, NOT 16:00:00. THIS IS BECAUSE A ROUND UP COULD
;	CAUSE THE DAY TO INCREMENT, AND THIS ROUTINE DOESN'T KNOW THE
;	DAY (IT HAS PROBABLY ALREADY BEEN PRINTED).  THE CALLER OF THIS
;	ROUTINE MUST MAKE SURE THE TIME HAS ALREADY BEEN ROUNDED TO THE
;	NEAREST SECOND HIMSELF.  SEE THE CODE AT .TDTTM FOR AN EXAMPLE.



.TTIMN::MSTIME	T1,		;GET CURRENT TIME

.TTIME::IDIV	T1,[^D3600000]	;GET HOURS
	MOVE	T4,T2		;SAVE REST
	PUSHJ	P,TDEC2Z	;TYPE TWO DIGITS
	PUSHJ	P,.TCOLN	;TYPE COLON
	MOVE	T1,T4		;RESTORE REST
	IDIVI	T1,^D60000	;GET MINS
	MOVE	T4,T2		;SAVE REST
	PUSHJ	P,TDEC2Z	;TYPE TWO DIGITS WITH 0 FILLER
	PUSHJ	P,.TCOLN	;TYPE COLON
	MOVE	T1,T4		;RESTORE THE REST
	IDIVI	T1,^D1000	;GET SECONDS
TDEC2Z:	MOVEI	T2,"0"		;FILL WITH 0
				;FALL INTO .TDEC2

;.TDEC2 -- TYPE DECIMAL AT LEAST TWO DIGITS
;CALL:	SAME AS .TDECW WITH T2=FILLER CHAR (" " OR "0")

.TDEC2::JUMPL	T1,.TDECW	;JUMP IF NEGATIVE
	CAILE	T1,^D9		;SEE IF ONE DIGIT
	PJRST	.TDECW		;NO--JUST OUTPUT
	EXCH	T1,T2		;GET FILLER
	PUSHJ	P,.TCHAR	;TYPE
	MOVEI	T1,"0"(T2)	;CONVERT DIGIT
	PJRST	.TCHAR		;OUTPUT IT AND RETURN
;.TFCHR -- TYPE POSSIBLY FUNNY CHARACTER
;CALL:	MOVEI	T1,CHARACTER
;	PUSHJ	P,.TFCHR
;USES T1, T2

.TFCHR::CAIL	T1,40		;SEE IF CONTROL CHARACTER
	JRST	TFCHR5		;NO--PROCEED
	MOVSI	T2,-LNSPCH	;SET SCAN LOOP
TFCHR2:	HLL	T1,SPCH(T2)	;MAKE T1 AGREE
	CAME	T1,SPCH(T2)	;SEE IF MATCH
	AOBJN	T2,TFCHR2	;NO--LOOP
	JUMPGE	T2,TFCHR3	;NO MATCH--PROCEED
	MOVEI	T1,"<"		;MATCH--TYPE INDICATOR
	PUSHJ	P,.TCHAR	; ..
	HLLZ	T1,SPCH(T2)	;GET MNEMONIC
	PUSHJ	P,.TSIXN	;TYPE IT
	MOVEI	T1,">"		;CLOSE
	PUSHJ	P,.TCHAR	;  INDICATOR
	POPJ	P,		;AND RETURN

TFCHR3:	ADDI	T1,100		;CONVERT
	PUSH	P,T1		; AND SAVE CHAR
	MOVEI	T1,"^"		;SET INDICATOR
	JRST	TFCHR7		;AND GO FINISH UP

TFCHR5:	CAIGE	T1,.CHGWD	;SEE IF GUIDE WORD		[507]
	JRST	TFCHR6		;NO--PROCEED			[507]
	SUBI	T1,.CHGWD	;REMOVE OFFSET			[507]
	PUSH	P,GUIDT.(T1)	;SAVE GUIDE WORD		[507]
	MOVEI	T1,"'"		;YES--INDICATE			[507]
	PUSHJ	P,.TCHAR	;OUTPUT GUIDE PREFIX		[507]
	POP	P,T1		;GET GUIDE WORD			[507]
	PUSHJ	P,.TSIXN	;OUTPUT AS SIXBIT		[507]
	MOVEI	T1,"'"		;ADD CLOSING			[507]
	PJRST	.TCHAR		; QUOTE				[507]

TFCHR6:	CAIN	T1,.CHDEL	;RUBOUT?
	PJRST	[MOVEI	T1,[ASCIZ\<DEL>\]
		PJRST	.TSTRG]		;PRINT FUNNY CHARACTER
	PJRST	.TCHAR		;PRINT NORMAL (UPPER/LOWER) ASCII GRAPHIC

;RDH	CAIGE	T1,140		;SEE IF LOWER CASE
;RDH	PJRST	.TCHAR		;NO--JUST TYPE IT
;RDH	SUBI	T1,40		;YES--CONVERT TO UPPER
;RDH	PUSH	P,T1		;SAVE FOR A MINUTE
;RDH	MOVEI	T1,"'"		;SET INDICATOR
TFCHR7:	PUSHJ	P,.TCHAR	;ISSUE INDICATOR
	POP	P,T1		;RESTORE FIXED CHAR
	PJRST	.TCHAR		;AND TYPE IT
;TABLE OF MNEMONIC,,CHARACTER

SPCH:	'EOF',,.CHEOF
	'EOL',,.CHEOL
	'ALT',,.CHALX
	'BEL',,.CHBEL
	'TAB',,.CHTAB
	'LF ',,.CHLFD
	'VT ',,.CHVTB
	'FF ',,.CHFFD
	'CR ',,.CHCRT
	'ESC',,.CHESC
LNSPCH==.-SPCH

;TABLE OF KNOWN GUIDE WORDS
; MUST BE IN ORDER OF VALUES OF THE META-CHARACTER
; (I.E., 4000, 4001, 4002, ETC.)

	DEFINE	YY($GUIDE),<SIXBIT \$GUIDE\>

GUIDT.::Z
	YY	AND
	YY	OR
	YY	NOT
	Z
	Z
	YY	BEGIN
	YY	END
	Z
	YY	IFAND
	Z
	YY	IFNOT
	Z
	Z
	Z
	Z
	YY	IFSAME
	YY	IFDIFF
	YY	IFOLDE
	YY	IFNEWE
	YY	IFSMAL
	YY	IFBIGG
GUIDL.==:.-GUIDT.
GUIDM.==:-GUIDL.
;.TVERW -- TYPE WORD IN VERSION NUMBER FORMAT
;CALL:	T1/ WORD
;	PUSHJ	P,.TVERW
;USES T1-4

.TVERW::MOVE	T4,T1		;PUT IN SAFE PLACE
	LDB	T1,[POINT 9,T4,11] ;GET MAJOR VERSION
	SKIPE	T1		;IF NON-ZERO,
	PUSHJ	P,.TOCTW	; PRINT IN OCTAL
	LDB	T1,[POINT 6,T4,17] ;GET MINOR VERSION
	JUMPE	T1,TVER2	;IF NON-ZERO,
	SOS	T1		;  PRINT IN MODIFIED
	IDIVI	T1,^D26		;  RADIX 26 ALPHA
	JUMPE	T1,TVER1	;  JUMP IF ONE CHAR
	MOVEI	T1,"A"-1(T1)	;  ISSUE FIRST OF TWO
	PUSHJ	P,.TCHAR	;  CHARACTERS
TVER1:	MOVEI	T1,"A"(T2)	;  ISSUE "UNITS"
	PUSHJ	P,.TCHAR	;  CHARACTER
TVER2:	HRRZ	T1,T4		;GET EDIT NUMBER
	JUMPE	T1,TVER3	;IF NON-ZERO,
	MOVEI	T1,"("		;  ISSUE
	PUSHJ	P,.TCHAR	;  AS OCTAL
	HRRZ	T1,T4		;  WITHIN
	PUSHJ	P,.TOCTW	;  PARENTHESES
	MOVEI	T1,")"		;  ..
	PUSHJ	P,.TCHAR	;  ..
TVER3:	LDB	T2,[POINT 3,T4,2] ;GET "WHO" FIELD
	JUMPE	T2,.POPJ	;IF NON-ZERO,
	MOVEI	T1,"-"		;  PRINT -
	PUSHJ	P,.TCHAR	;  AND THEN
	MOVE	T1,T2		;  THE FIELD
	PJRST	.TOCTW		;  AS OCTAL
;.TBLOK -- TYPE NUMBER IN BLOCKS, ETC.
;.TCORW -- TYPE NUMBER IN CORE SIZE
;CALL:	1/ SIZE TO TYPE
;	PUSHJ	P,.TBLOK/.TCORW
;USES T1-4

.TBLOK::TRNE	T1,177		;SEE IF EVEN BLOCKS
	PJRST	TCORWD		;NO--ISSUE IN WORDS
	MOVE	T4,["B",,177]	;ELSE INDICATE BLOCKS
	JRST	TCORTP		;AND GO OUTPUT

.TCORW::JUMPE	T1,TCORWD	;IF NULL, DO IN WORDS
	MOVE	T4,["K",,1777]	;PRESET FOR K
	JUMPPT	(T2,TCORKA,TCORKA)  ;IF PDP-6 OR KA-10, DO IN K
	MOVE	T4,["P",,777]	;ELSE, INDICATE PAGES
TCORKA:	TDNE	T1,T4		;SEE IF ROUND UNITS
	JRST	TCORWD		;NO--DO IN WORDS
TCORTP:	IDIVI	T1,1(T4)	;YES--DIVIDE BY UNITS
	SKIPA			; AND OUTPUT
TCORWD:	MOVSI	T4,"W"		;INDICATE WORDS
	PUSHJ	P,.TDECW	;ISSUE SIZE
	HLRZ	T1,T4		;GET SIZE UNIT INDICATOR
	PJRST	.TCHAR		;ISSUE THAT AND RETURN
;.TCRLF -- TYPE CARRIAGE RETURN/LINE FEED
;CALL:	PUSHJ	P,.TCRLF
;PRESERVES ALL ACS

.TCRLF::PUSH	P,T1		;SAVE CHARACTER
	MOVEI	T1,.CHCRT	;GET CARRIAGE RETURN
	PUSHJ	P,.TCHAR
	MOVEI	T1,.CHLFD	;GET LINE FEED
	PUSHJ	P,.TCHAR	;TYPE IT
TPOPJ:	POP	P,T1		;RESTORE CHARACTER
	POPJ	P,		;RETURN


;.TPPNW -- SUBROUTINE TO TYPE A PPN
;CALL:	MOVE	T1,PPN
;	PUSHJ	P,.TPPNW
;USES	T1, T2, T3

.TPPNW::PUSH	P,T1		;SAVE ARGUMENT
	PUSHJ	P,.TLBRK	;START UP A PPN
	POP	P,T1		;RECOVER ARGUMENT
	JUMPL	T1,[PUSHJ P,.TSIXN
		    JRST  .TRBRK]
	PUSHJ	P,.TXWDW	;TYPE XWD
	PJRST	.TRBRK		;CAP OFF THE PPN


;.TSIXN -- TYPE OUT SIXBIT WORD
;CALL:	MOVE	T1,WORD
;	PUSHJ	P,.TSIXN
;USES T1, T2

.TSIXN::MOVE	T2,T1		;MOVE ARGUMENT
TSIXN1:	JUMPE	T2,.POPJ	;LOOP UNTIL ONLY BLANKS LEFT
	MOVEI	T1,0		;CLEAR NEXT CHARACTER
	LSHC	T1,6		;GET NEXT CHARACTER
	ADDI	T1," "-' '	;CONVERT TO ASCII
	PUSHJ	P,.TCHAR	;TYPE IT
	JRST	TSIXN1		; ..
;.TXWDW -- TYPE OUT N AS TWO OCTAL HALF-WORDS
;CALL:	MOVE	T1,WORD
;	PUSHJ	P,.TXWDW
;USES T1, T2, T3

.TXWDW::PUSH	P,T1		;PRESERVE ARGUMENT
	HLRZ	T1,T1
	PUSHJ	P,.TOCTW
	PUSHJ	P,.TCOMA	;ISSUE COMMA
	POP	P,T1		;RESTORE ARGUMENT
	HRRZ	T1,T1
			;FALL INTO .TOCTW


;.TDECW -- TYPE OUT SIGNED DECIMAL NUMBER
;.TOCTW -- TYPE OUT SIGNED OCTAL NUMBER
;.TRDXW -- TYPE OUT SIGNED NUMBER (RADIX IN T3)
;	(IF RADIX .GT. 9, WILL USE ALPHAS AFTER DIGITS)
;CALL:	MOVE	T1,NUMBER
;	PUSHJ	P,.TOCTW/.TDECW/.TRDXW
;USES T1, T2, T3

.TOCTW::SKIPA	T3,[10]		;INITIALIZE FOR OCTAL RADIX
.TDECW::MOVEI	T3,^D10		;INITIALIZE FOR DECIMAL RADIX
.TRDXW::JUMPGE	T1,TRDXW1	;CHECK FOR NEGATIVE
	MOVE	T2,T1		;SAVE AWAY ARGUMENT
	MOVEI	T1,"-"		;YES--GET MINUS
	PUSHJ	P,.TCHAR	;PRINT IT
	MOVE	T1,T2		;RESTORE NUMBER
TRDXW1:	IDIV	T1,T3		;DIVIDE BY RADIX
	MOVMS	T2		;GET MAGNITUDE
	PUSH	P,T2		;SAVE REMAINDER
	SKIPE	T1		;SEE IF ANYTHING LEFT
	PUSHJ	P,TRDXW1	;YES--LOOP BACK WITH PD LIST
	POP	P,T1		;GET BACK A DIGIT
	ADDI	T1,"0"		;CONVERT TO ASCII
	CAILE	T1,"9"		;SEE IF OVERFLOW DIGITS
	ADDI	T1,"A"-"9"-1	;YES--SWITCH TO ALPHABETICS
	PJRST	.TCHAR		;TYPE IT AND RETURN
;.TDECD -- TYPE OUT SIGNED DECIMAL DOUBLE-WORD NUMBER
;.TOCTD -- TYPE OUT SIGNED OCTAL DOUBLE-WORD NUMBER
;.TRDXD -- TYPE OUT SIGNED DOUBLE-WORD NUMBER (RADIX IN T3)
;	(IF RADIX .GT. 9, WILL USE ALPHAS AFTER DIGITS)
;CALL:	MOVE	T1+T2,NUMBER
;	PUSHJ	P,.TOCTD/.TDECD/.TRDXD
;USES T1, T2, T3, T4

.TOCTD::SKIPA	T3,[10]		;INITIALIZE FOR OCTAL RADIX
.TDECD::MOVEI	T3,^D10		;INITIALIZE FOR DECIMAL RADIX
.TRDXD::PUSHJ	P,.SAVE4##	;NEED LOTS OF ACS HERE!
	MOVE	T4,T3		;POSITION RADIX
	SETZ	T3,		;AND MAKE A DOUBLE-WORD OUT OF IT
	DMOVE	P1,T1		;POSITION NUMBER OUT OF HARM'S WAY
	JUMPGE	T1,TRDXD1	;CHECK FOR NEGATIVE
	MOVEI	T1,"-"		;YES--GET MINUS
	PUSHJ	P,.TCHAR	;PRINT IT
	SETOB	P3,P4		;DOUBLE-WORD -1
	DMUL	P1,P3		;QUAD WORD BUT POSITIVE "RIGHT HALF"
	DMOVE	P1,P3		;POSITION POSITIVE DOUBLE-WORD
TRDXD1:	DMOVE	P3,P1		;LOW-ORDER HALF OF QUAD-WORD
	SETZB	P1,P2		;HIGH-ORDER HALF OF QUAD WORD
	DDIV	P1,T3		;DIVIDE BY RADIX
	PUSH	P,P4		;SAVE REMAINDER
	CAIN	P1,0		;IF DOUBLE-WORD
	CAIE	P2,0		; QUOTIENT IS STILL NON-ZERO
	PUSHJ	P,TRDXD1	;THEN RECURSE BACK FOR REMAINDER
	POP	P,T1		;GET BACK A DIGIT
	ADDI	T1,"0"		;CONVERT TO ASCII
	CAILE	T1,"9"		;SEE IF OVERFLOW DIGITS
	ADDI	T1,"A"-"9"-1	;YES--SWITCH TO ALPHABETICS
	PJRST	.TCHAR		;TYPE IT AND RETURN
;.T----  --  TYPE OUT SPECIFIC CHARACTER
;
;ALL USE T1

.TTABC::MOVEI	T1,.CHTAB	;GET TAB
	PJRST	.TCHAR		;ISSUE AND RETURN

.TSPAC::MOVEI	T1," "		;GET A SPACE
	PJRST	.TCHAR		;ISSUE AND RETURN

.TBANG::MOVEI	T1,"!"		;GET EXCLAMATION POINT
	PJRST	.TCHAR		;ISSUE AND RETURN

.TDQTE::MOVEI	T1,""""		;GET DOUBLE-QUOTE
	PJRST	.TCHAR		;ISSUE AND RETURN

.THASH::MOVEI	T1,"#"		;GET HASH MARK
	PJRST	.TCHAR		;ISSUE AND RETURN

.TPERC::MOVEI	T1,"%"		;GET PERCENT-SIGN
	PJRST	.TCHAR		;ISSUE AND RETURN

.TSQTE::MOVEI	T1,"'"		;GET SINGLE-QUOTE
	PJRST	.TCHAR		;ISSUE AND RETURN

.TASTR::MOVEI	T1,"*"		;GET ASTERISK
	PJRST	.TCHAR		;ISSUE AND RETURN

.TCOMA::MOVEI	T1,","		;GET COMMA
	PJRST	.TCHAR		;ISSUE AND RETURN

.TDASH::MOVEI	T1,"-"		;GET DASH
	PJRST	.TCHAR		;ISSUE AND RETURN

.TDOT::	MOVEI	T1,"."		;GET DOT (OR PERIOD)
	PJRST	.TCHAR		;ISSUE AND RETURN

.TSLAS::MOVEI	T1,"/"		;GET SLASH
	PJRST	.TCHAR		;ISSUE AND RETURN

.TCOLN::MOVEI	T1,":"		;GET COLON
	PJRST	.TCHAR		;ISSUE AND RETURN

.TSEMI::MOVEI	T1,";"		;GET SEMI-COLON
	PJRST	.TCHAR		;ISSUE AND RETURN

.TQUES::MOVEI	T1,"?"		;GET QUESTION-MARK
	PJRST	.TCHAR		;ISSUE AND RETURN

.TLANG::MOVEI	T1,"<"		;LEFT (OPEN) ANGLE BRACKET
	PJRST	.TCHAR		;ISSUE AND RETURN

.TRANG::MOVEI	T1,">"		;RIGHT (CLOSE) ANGLE BRACKET
	PJRST	.TCHAR		;ISSUE AND RETURN

.TLPRN::MOVEI	T1,"("		;LEFT (OPEN) PARENTHESIS
	PJRST	.TCHAR		;ISSUE AND RETURN

.TRPRN::MOVEI	T1,")"		;RIGHT (CLOSE) PARENTHESIS
	PJRST	.TCHAR		;ISSUE AND RETURN

.TLBRK::MOVEI	T1,"["		;LEFT (OPEN) SQUARE BRACKET
	PJRST	.TCHAR		;ISSUE AND RETURN

.TRBRK::MOVEI	T1,"]"		;RIGHT (CLOSE) SQUARE BRACKET
	PJRST	.TCHAR		;ISSUE AND RETURN

.TLBRC::MOVEI	T1,"{"		;LEFT (OPEN) BRACE
	PJRST	.TCHAR		;ISSUE AND RETURN

.TRBRC::MOVEI	T1,"}"		;RIGHT (CLOSE) BRACE
	PJRST	.TCHAR		;ISSUE AND RETURN
;.TSTRG -- TYPE ASCIZ STRING
;CALL:	MOVEI	T1,LOCTN. OF STRING
;	PUSHJ	P,.TSTRG
;USES T1

.TSTRG::HRLI	T1,(POINT 7)	;CONVERT ADDRESS TO POINTER
	TRNN	T1,-1		;SEE IF SOMETHING THERE
	POPJ	P,		;NO--RETURN EMPTY HANDED
	PUSH	P,T1		;STORE IN SAFE PLACE		[501]
TSTRG1:	ILDB	T1,(P)		;GET NEXT CHARACTER		[501]
	JUMPE	T1,TPOPJ	;RETURN WHEN DONE		[501]
	PUSHJ	P,.TCHAR	;OUTPUT CHARACTER
	JRST	TSTRG1		;LOOP UNTIL DONE


;.TCHAR -- TYPE ASCII CHARACTER
;CALL:	MOVEI	T1,CHARACTER
;	PUSHJ	P,.TCHAR
;PRESERVES ALL ACS

.TCHAR::SKIPE	TYPOUT		;SEE IF SPECIAL ROUTINE
	PJRST	@TYPOUT		;YES--GO DO IT INSTEAD
	OUTCHR	T1		;LET MONITOR DO IT
.POPJ:	POPJ	P,		;AND RETURN
;DATA STORAGE AREA

	RELOC
.TOUTZ::!			;START OF LOW CORE AREA
TYPOUT: BLOCK	1		;ROUTINE TO TYPE ONE CHARACTER
.TOUTL==:.-.TOUTZ		;LENGTH OF LOW CORE AREA
	RELOC
	PRGEND
	TITLE	.VERBO -- ROUTINE TO RETURN /MESSAGE SETTINGS
	SUBTTL

	SEARCH	SWIDEF,	SWIL		;SWIL PACKAGE DEFINTIONS
	SEARCH	JOBDAT,	MACTEN,	UUOSYM	;STANDARD DEFINITIONS

	SALL				;PRETTY LISTINGS
	.DIREC	FLBLST			;PRETTIER LISTINGS

	TWOSEG	400000			;NICE PURE CODE

;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  ALL RIGHTS RESERVED.

	COMMENT	\

COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  ALL RIGHTS RESERVED.


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND 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.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
CORPORATION.

DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

\
DEFINE CLEARO,<
 IFE FT$TNX,<
	SKPINL
	  JFCL
>

 IFN FT$TNX,<
	MOVEI	T1,.PRIOU
	RFMOD
	TXO	T2,TT%OSP
	SFMOD
>>

IFN FT$TNX,<
 DEFINE OUTSTR (TEXT)<
	HRROI	1,TEXT
	PSOUT
>

DEFINE OUTCHR (ACC)<
 IFN ACC-1,<
	HRRZ	1,ACC
>
	PBOUT
>
>;END IFN FT$TNX
;ENTRY POINTS

	ENTRY	.VERBO,.ERMSA,.ERMSG
;.ERMSG/.ERMSA -- ROUTINES TO ISSUE STANDARD ERROR MESSAGE PREFIXES
;CALL:	1/ MODULE CODE (0=SYSTEM),,MESSAGE CODE   IN SIXBIT
;	2/ (11) ??? (7) LEAD CHAR,,[ASCIZ TEXT]
;	3/ ???,,ADDRESS OF ERROR IF .ERMSA
;	PUSHJ P,.ERMSG/.ERMSA
;RETURN +1 WITH 1/ LH(ARG 2),,/VERBOS BITS
;USES T2-4

.ERMSG::MOVEI	T3,0		;CLEAR ADDRESS
.ERMSA::PUSH	P,T2		;SAVE CONTROL BITS
	PUSH	P,T3		;SAVE ADDRESS
	PUSH	P,T1		;SAVE PREFIXES
	HLRZ	T1,T2		;GET PREFIX CHARACTER
	ANDI	T1,177		;MASK TO JUST LEAD CHARACTER
	CAIN	T1,"?"		;IF FATAL ERROR,
	SKIPE	.FLCBF		;SEE IF FIRST FATAL ERROR	[354,567]
	JRST	ERMSG1		;NO, PROCEED			[567]
	CLEARO			;YES--CLEAR ^O			[567]
	SETOM	.FLCBF		; INDICATE TO CLEAR TYPE-AHEAD
ERMSG1:	PUSHJ	P,.TNEWL##	;GO TO START OF LINE		[355]
	PUSHJ	P,.TCHAR##	;ISSUE LEAD CHARACTER
	PUSHJ	P,.VERBO	;GET /MESSAGE
	MOVE	T4,T1		;COPY TO SAFER PLACE
	POP	P,T1		;GET PREFIX
	TLNN	T1,-1		;SEE IF SYSTEM CODE
	HRLZS	T1		;YES--REMOVE SPACES
	TXNE	T4,JWW.PR	;SEE IF /VERBOS:PREFIX
	PUSHJ	P,.TSIXN##	;YES--ISSUE PREFIX
	POP	P,T3		;GET ADDRESS OF CALL
	TRNE	T3,-1		;SEE IF CALL ADDRESS SET
	TXNN	T4,1_<VRBADX-1>	; AND IF USER ASKED FOR IT
	JRST	ERMSG2		;NO--PROCEED BELOW
	MOVEI	T1,"("		;YES--INDICATE
	PUSHJ	P,.TCHAR##	; ADDRESS
	HRRZ	T1,T3		;GET ADDRESS
	PUSHJ	P,.TOCTW##	; TYPE IN OCTAL
	MOVEI	T1,")"		;GET END
	PUSHJ	P,.TCHAR##	; AND INDICATE
ERMSG2:	PUSHJ	P,.TSPAC##	;SPACE OVER TO TEXT AREA
	HRRZ	T1,(P)		;GET TEXT ADDRESS
	TXNE	T4,JWW.FL	;SEE IF /MESSAGE:FIRST
	PUSHJ	P,.TSTRG##	;YES--ISSUE TEXT
	POP	P,T1		;RESTORE FLAGS (???)
	ANDX	T4,JWW.CN!JWW.FL;REMOVE JUNK BITS
	HRR	T1,T4		;MOVE TO ANSWER
	POPJ	P,		;RETURN
;.VERBO -- ROUTINE TO RETURN /MESSAGE SETTING
;CALL:	PUSHJ	P,.VERBO
;RETURNS T1/BITS IN JWW.?? FORMAT

.VERBO::
IFE FT$TNX,<
	HRROI	T1,.GTWCH	;GET FROM MONITOR
	GETTAB	T1,		;THE USER'S DEFAULT
>
	  MOVEI	T1,0		;(DEFAULT TO 0)
	TXNN	T1,JW.WMS	;SEE IF SET
	TXO	T1,.JWWPO_<ALIGN. (JW.WMS)>  ;NO--DEFAULT TO PREFIX,FIRST
	ANDX	T1,JW.WMS	;REMOVE JUNK
	LSH	T1,^D18-<ALIGN.(JW.WMS)> ;ALIGN IN LEFT HALF
	ANDCM	T1,.FLVRB	;CLEAR ANY SET IN SWITCH
	HLRZS	T1		;POSITION TO RIGHT
	IOR	T1,.FLVRB	;INCLUDE ANY SET IN SWITCH
	TLZ	T1,-1		;CLEAR JUNK
	TRNE	T1,JWW.CN	;SEE IF CONTINUATION
	TRO	T1,JWW.FL	;YES--SET FIRST
	SKIPN	T1		;SEE IF ANYTHING LEFT
	TRO	T1,.JWWPO	;NO--SET FIRST,PREFIX
	POPJ	P,		;RETURN
	RELOC
.VRBOZ::!			;START OF LOW CORE AREA
.FLVRB::BLOCK	1		;MASK,,SET OF /MESSAGE BITS
.FLCBF::BLOCK	1		;FLAG TO CLEAR TYPEAHEAD
.VRBOL==:.-.VRBOZ		;LENGTH OF LOW CORE AREA
	RELOC

	PRGEND
	TITLE	.TNEWL -- ROUTINE TO FORCE OUTPUT TO START OF LINE
	SUBTTL

	SEARCH	SWIDEF,	SWIL		;SWIL PACKAGE DEFINTIONS
	SEARCH	JOBDAT,	MACTEN,	UUOSYM	;STANDARD DEFINITIONS

	SALL				;PRETTY LISTINGS
	.DIREC	FLBLST			;PRETTIER LISTINGS

	TWOSEG	400000			;NICE PURE CODE

;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  ALL RIGHTS RESERVED.

	COMMENT	\

COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1984,1986.  ALL RIGHTS RESERVED.


THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND 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.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
TRANSFERRED.

THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
CORPORATION.

DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.

\
;ENTRY POINTS

	ENTRY	.TNEWL

.TNEWL::PUSHJ	P,.SAVE4##	;SAVE THE P ACS
TNEWL0:	MOVE	P1,[2,,P2]	;TRMOP. ARG POINTER
	MOVEI	P2,.TOSOP	;SKIP IF STILL HAVE OUTPUT
	SETO	P3,		;-1 = US
	TRMOP.	P1,		;ASK MONITOR ABOUT TTY OUTPUT
	 JRST	TNEWL5		;NO OUTPUT PENDING
	MOVEI	P1,0		;OUTPUT PENDING
	SLEEP	P1,		;SLEEP A BIT
	JRST	TNEWL0		;AND CHECK AGAIN

TNEWL5:	MOVE	P1,[2,,P2]	;TRMOP. ARG POINTER
	MOVEI	P2,.TOHPS	;FOR READING HORIZONTAL POSITION
	SETO	P3,-1		;-1 = US
	TRMOP.	P1,		;ASK MONITOR ABOUT "CURSOR" POSITION
	 CAIA			;ASSUME NEED <CR><LF>
	JUMPE	P1,.POPJ##	;IF 0 THEN AT LEFT MARGIN, NO <CR><LF> NEEDED
	PJRST	.TCRLF##	;NOT AT LEFT MARGIN, GET A <CR><LF> OUT
	END