/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/COPYRIGHT 1972,1973,1974 DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
/EDIT #012	1/9/74
       .TITLE SPMSG
/OBJECT TIME MESSAGE PRINT ROUTINE FOR STOP AND PAUSE.
/FOR BACKGROUND/FOREGROUND DEFINE BF
/FOR RSX SYSTEM,DEFINE RSX.
/FOR ADSS SYSTEMS DEFINE ADSS
/WITH RSX,SPMSG PRINTS CALLER'S NAME, AN OCTAL NUMBER AND
/DETERMINES THE TASK NAME BEFORE RETURNING TO THE CALLER.
/MSG. OUTPUT TO LUN-4.
/XR10 MUST BE SAVED AND RESTORED IF TASK IS TO BE RESUMED
/AFTER A MESSAGE S PRINTED.
/CALLING SEQUENCE--LAC   OCTAL INTEGER TO BE PRINTED.
/                  JMS*  .SP
/                  .DSA  CONTROL RETURN (MEANINGFUL TO PAUSE ONLY)
/ LAC IF NOT RSX                  (LAC)   1ST CHARACTER
/                  (LAC)   2ND CHARACTER
/                  (LAC)   3RD CHARACTER
/                  (LAC)   4TH CHARACTER
/                  (LAC)   5TH CHARACTER
/                  (LAC)   6TH CHARACTER
/
	.IFUND RSX
       .GLOBL .SP
	.GLOBL SPMSG
	.IFDEF BF
	.GLOBL PACPF
	.ENDC
	.IFUND BF
	.IFUND ADSS
.SCOM=100
	.ENDC
	.ENDC
SPMSG=.
.SP    CAL    0
       DAC    SAVE           /SAVE OCTAL NUMBER TO BE PRINTED.
       LAC    FSTADD         /SET CURRENT ADDRESS TO ADDRESS OF FIRST
       DAC    CURADD         /   DATA WORD IN BUFFER.
       LAW    -6             /SET COUNTER TO FETCH 6 CHARACTERS FROM
       DAC    CNT            /   CALLING ROUTINE.
	.IFUND BF
       LAC*   .SP            /FETCH CONTROL RETURN ADDRES FOR .INIT
       DAC    SP3
	.ENDC
       ISZ    .SP
SP1	XCT*	.SP	/FETCH ALPHA CHARACTER IN ASCII-7 -ASSIGNED TO GLOBL SPMSG
       DAC*   CURADD         /   STORE IN BUFFER.
       ISZ    .SP            /BUMP FETCH-ADDRESS, STORE-ADDRESS, AND
       ISZ    CURADD         /   CHARACTER COUNT.
       ISZ    CNT
       JMP    SP1            /NOT DONE--GET NEXT CHARACTER.
       LAW    -6             /DONE--SET UP SAVED INTEGER TO OUTPUT 6
       DAC    CNT            /   OCTAL DIGITS.
       LAC    SAVE
       RCL!SKP
SP2    LAC    SAVE
       RTL                   /ROTATE NEXT 3 BITS INTO LOW BITS OF AC.
       RAL
       DAC    SAVE           /SAVE FOR NEXT SHIFT.
       AND    (7)            /MAKE IT AN ASCII-7 CHARACTER.
	XOR L260
       DAC*   CURADD         /STORE IT IN BUFFER--CONTINUE UNTIL ALL L
       ISZ    CURADD         /   OCTAL DIGITS ARE IN BUFFER.
       ISZ    CNT
       JMP    SP2            /NOT DONE--GET NEXT DIGIT.
	.IFUND BF
	.IFUND ADSS
	JMS	BIT4		/FOR DOS AND BOSS ONLY
	.ENDC
	.ENDC
	.IFUND BF
       CAL    01775          /DONE--INITIALIZE TELEPRINTER.
       .DSA   1
SP3    .DSA   SP3            /CONTROL ADDRESS
       .DSA   0
	.ENDC
	.IFDEF BF
	CAL	1775		/REAL TIME .INIT TO SLOT -3
	.DSA	1		/AND FOR OUTPUT
	SP4+100000		/ADDR OF REAL TIME SUBR.
	0
	.ENDC
	.IFUND BF
	.IFUND ADSS
	JMS	BIT4		/FOR DOS AND BOSS ONLY
	.ENDC
	.ENDC
       CAL    03775          /PRINT 12 CHARACTERS IN IMAGE-ALPHA.
       .DSA   11
       .DSA   BUFF
L260	.DSA 260
	.IFUND BF
	.IFUND ADSS
	JMS	BIT4		/FOR DOS AND BOSS ONLY
	.ENDC
	.ENDC
       CAL    00775          /WAIT FOR TELEPRINTER TO FINISH.
	.DSA 6
       JMP*   .SP            /RETURN TO CALLER.
	.IFDEF BF
SP4	0
	DAC	SP5		/SAVE AC
	LAC	SPBFC
	DAC	PACPF
	CAL	1775		/.INIT FOR CR/LF
	.DSA	1
	.DSA	0
	.DSA	0
	LAC	SP5		/RESTORE AC
	CAL	SP4		/.RLXIT
	.DSA	20
SP5	0			/STORAGE FOR AC
SPBFC	1			/FLAG FOR PACPF - CHECKED
PACPF	0	/CONTROL P FLAG
	.ENDC			/IN PAUSE
	.IFUND BF
	.IFUND ADSS
BIT4	0			/FOR BOSS-15
	LAC*	FSTADD
	AND	(177
	SAD	ASCIP
	SKP
	JMP*	BIT4
	LAC*	(.SCOM+52	/BOSS REGISTER
	XOR	(020000		/SET BIT 4
	AND	(020000		/SO PAUSE WILL PRINT ON TTY
	XOR*	(.SCOM+52
	DAC*	(.SCOM+52
	JMP*	BIT4
ASCIP	120			/7 BIT ASCII 'P'
	.ENDC
	.ENDC
CURADD .DSA   0              /CURRENT BUFFER ADDRESS.
SAVE   .DSA   0              /TEMP STORAGE FOR OCTAL INTEGER.
CNT    .DSA   0              /CHARACTER COUNT.
FSTADD .DSA   BUFF+2         /FIRST BUFFER ADDRESS AFTER HEADER WORDS.
BUFF   .DSA   007003         /BUFFER AND HEADER.
       .DSA   0
       .BLOCK 14
	.IFUND BF
	.IFUND ADSS
	15
	.ENDC
	.ENDC
	.ENDC
	.IFDEF RSX
	.GLOBL	.SP
	.GLOBL	.SM
	.GLOBL	.SA
	.GLOBL	SPMSG
SPMSG=.
ECLA=641000
X10=10
.SP	CAL	0
	LMQ		/SAVE OCTAL NUMBER TO BE PRINTED
	LAC	.SA	/SET CURRENT ADDRESS TO POINT TO FIRST
	DAC*	(X10)	/WORD IN OUTPUT BUFFER
	LAW	-6	/FETCH FIVE CHARACTERS
	DAC	CNT
	DAC	CNT1	/DET UP FOR 6 OCTAL CHARACTERS ALSO
SP1	LAC*	.SP	/FETCH ALPHA CHARACTER
	DAC*	X10	/STORE IT IN BUFFER
	ISZ	.SP	/INCREASE SP TO FETCH NEXT CHARACTER
	ISZ	CNT	/DONE COPYING 7 CHARACTERS?
	JMP	SP1	/NO- PICK UP THE NEXT ONE
SP2	ECLA!LLS 3	/SHIFT 3 CHARACTERS OF OCTAL NUMBER INTO AC
	AAC	60	/MAKE IT ASCII
	DAC*	X10	/PUT  IT IN BUFFER
	ISZ	CNT1	/FINISHED COPYING 6 OCTAL CHARACTERS?
	JMP	SP2	/NO PICK UP ANOTHER ONE
.SM	LAC*	X10	/SPACE BUFFER POINTER
	LAC*	(X10)	/SAVE AUTO-INDEX REG. 10.
	DAC	CNT1	/INTEGRITY NOT INSURED AROUND CAL.
	CAL	TSKNM	/GET TASKNAME.
	LAC	CNT1	/RESTORE AUTO-INDEX REG. 10.
	DAC*	(X10)
	LAW	-2	/TASK NAME IS TWO WORDS
	DAC	CNT
SP4	LAC	TSKNMA	/PICK UP TASK NAME
SP4A	LMQ		/PUT IT IN MQ
	LAW	-3	/3 CHARACTERS PER WORD
	DAC	CNT1
SP3	ECLA!LLS 6	/SHIFT 6 BITS INTO AC
	SNA		/IF NULL MAKE IT A SPACE
	JMP	SP5
	AAC	-40	/SUBTRACT 40 TO
	SPA		/DETERMINE IF ALPHA OR SPECIAL CHARACTER
	AAC	100	/ADD 100 IF ALPHA
SP5	AAC	40	/ADD 40 TO REGAIN ORIG. VALUE
	DAC*	X10	/STORE IN BUFFER
	ISZ	CNT1	/FINISHED THIS WORD?
	JMP	SP3	/NO PICK UP ANOTHER CHARACTER
	LAC	TSKNMB		/GET 2OND WORD OF TASKNAME
	ISZ	CNT	/FINISHED TASK NAME?
	JMP	SP4A	/NO PICK UP SECOND WORD
	CAL	SPTTY	/PRINT MESSAGE
	CAL	WFTTY	/WAIT FOR TTY TO FINISH
	JMP*	.SP	/RETURN
/
SPTTY	2700	/OUTPUT ON LUN 3
	CNT	/EVENT VARIABLE ADDRESS
	3	/LOGICAL UNIT NUMBER
	3	/IMAGE ASCII
	BUFF	/ADDRESS OF MESSAGE
/
/GET TASKNAME PAR. BLOCK.
TSKNM	25
	CNT		/EV
TSKNMA	0		/FIRST HALF TSKNAME (RETURNED)
TSKNMB	0		/SECOND HALF TSKNAME (RETURNED)
/
.SA	BUFF+2	/FIRST ADDRESS POINTER
BUFF	014003	/HEADER
	0
	.BLOCK 7	/TYPE OF ERROR
	.REPT	6
	040		/OCTAL NUMBER
	055		/-
	.BLOCK	6	/TASK NAME
	15	/CR
	12	/LF
/
WFTTY	20
	CNT
/
CNT	0
CNT1	0
	.ENDC
       .END
