Google
 

Trailing-Edge - PDP-10 Archives - BB-D480C-SB_1981 - forpse.mac
There are 13 other files named forpse.mac in the archive. Click here to see a list.
	SEARCH	FORPRM
	TV	FORPSE	PAUSE AND STOP ROUTINES,6(2031)
	SUBTTL	ED YOURDAN/D. TODD/DRT/HPW/DPL/SWG	25-OCT-79




;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

;COPYRIGHT (C) 1977,1981 BY DIGITAL EQUIPMENT CORPORATION

COMMENT \

***** Begin Revision History *****

423			15030
	Fix PAUSE destroying a reg.

1100	SWG
	From 4B(423); cleanup for V6; remove F40 conditional
	replace TTCALL; conditionalize for -10/-20;
	modify so STOP not printed out.

1525	JLC/AHM	07-Jul-81
	Fix to output * after pausing, count was in octal instead
	of decimal. Fix save/restore ac code.

***** End Revision History *****

\

	SUBTTL	PAUSE AND STOP FUNCTION

;THE PAUSE SUBROUTINE MAY BE CALLED FOR ANY OF THE THREE
;FOLLOWING FORTRAN STATEMENTS:
;	PAUSE
;	PAUSE N
;	PAUSE "MESSAGE"
;WHERE N IS AN OCTAL NUMBGIT STRING OF UP TO 6 DIGITS
;AND "MESSAGE" IS AN ASCII MESSAGE.
;THE CALLING SEQUENCE FOR PAUSE IS:
;	MOVEI	L,ARGBLK
;	PUSHJ	P,PAUSE.
;
;AFTER TYPING PAUSE, THE DIGIT STRING AND/OR A MESSAGE, THE
;ROUTINE ALLOWS THE USER TO CONTINUE BY TYPING A 'G', FOLLOWED
;BY A CARRIAGE RETURN, AND ALLOWS HIM TO EXIT BY TYPING AN
;'X', FOLLOWED BY A CARRIAGE RETURN.
;
;THE ARGUMENTS HANDLED AND THE CALLING SEQUENCE FOR STOP
;ARE IDENTICAL TO THOSE FOR PAUSE.  STOP, HOWEVER, DOES
;NOT OUTPUT THE WORD 'STOP' AND ALWAYS CALLS EXIT TO
;TERMINATE.

	TWOSEG	400000

	HELLO	(PAUS.)
	SETOM	PSEFLG		;FLAG=-1 FOR PAUSE ENTRY
	JRST	PSEARG		;SKIP STOP ENTRY

	HELLO	(STOP.)		;STOP ENTRY
	SETZM	PSEFLG		;FLAG=0 FOR STOP ENTRY

PSEARG:
	PUSH	P,T0
	PUSH	P,T1
	PUSH	P,L
IF10,<
	SKPINL			;TURN OFF ^O
	  JFCL
>				;END IF10

IF20,<				;NEED TO SAVE AND RESTORE  T2
	PUSH	P,T2		;ACS USED FOR JSYS
	MOVEI	T1,.PRIOU
	RFMOD%
	TXZE	T2,TT%OSP
	  SFMOD%
	POP	P,T2		;AND RESTORE
>				;END IF20
	SETZ	T1,		;ASSUME NO ARG
	SKIPL	-1(L)		;IS THERE AN ARG
	  JRST	PAUSEZ		;NO ARGUMENT
	LDB	T1,[POINT 4,(L),12]	;GET THE ARG TYPE
	CAIE	T1,TP%LIT	;LITERAL STRING
	  JRST	PAUSEN		;NO, A CONSTANT
	MOVSI	T1,(POINT 7)	;GET A BYTE POINTER
	HRRI	T1,@(L)		;GET THE ADDRESS
	ILDB	T0,T1		;GET A CHARACTER
	JUMPN	T0,.-1		;COUNT THE NUMBER OF WORDS
	SUBI	T1,@(16)	;NUMBER OF WORDS IN THE STING
	MOVSI	T1,1(T1)	;BUILD THE AOB POINTER
	HRRI	T1,@(L)		;GET THE STRING ADDRESS
				;OUTPUTTING CHARACTER STRING
	HLRE	T0, T1		;GET WORD COUNT OF MESSAGE
	MOVNS	T0		;MESSAGE - FORM AOBJN WORD
	HRLM	T0, T1		;IN ACCUMULATOR T1
	SKIPN	PSEFLG		;SKIP NEXT INSTR IF PAUSE CALL
	  JRST	PAUSE1		;STOP - GOTO HANDLE IT
	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS3>,5>
	JRST	PRLOOP		;SKIP STOP CODE
PAUSE1:	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS3S>,2>	;STOP SETUP
PRLOOP:	FUNCT	IOLST.##,<<XWD 001100,(T1)>,0>
	AOBJN	T1, PRLOOP	;LOOP BACK FOR MORE WORDS
	FUNCT	FIN.##
	JRST	PAUSE6	;ALL DONE, TYPE G AND X STUFF
PAUSEN:
	HRRO	T1,(L)		;GET THE ADDRESS OF THE CONSTANT
	HRRZ	T0,(T1)		;GET THE NUMBER
	SKIPN	PSEFLG		;IS THIS PAUSE?
	  JRST	PAUSE2		;NO - STOP
	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS4>,3>
	JRST	PAUSE3
PAUSE2:	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS4S>,2>
PAUSE3:	FUNCT	IOLST.##,<<XWD 001100,T0>,<XWD 4000,0>>
	JRST	PAUSE6

PAUSEZ:	SKIPN	PSEFLG		;IS IT PAUSE?
	  JRST	PAUSE8		;NO - STOP - GET OUT
	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS5>,2>
	FUNCT	FIN.##

;TYPE G TO CONTINUE CODE
PAUSE6:	SKIPN	PSEFLG		;PAUSE?
	  JRST	PAUSE8		;NO - STOP - GET OUT
	FUNCT	OUT.##,<<XWD 0,-1>,0,0,<XWD 100,MESS1>,^D11>
	FUNCT	FIN.##
	FUNCT	IN.##,<<XWD 0,-4>,0,0,<XWD 100,MESS2>,1>
	FUNCT	IOLST.##,<<XWD 001100,T0>,<XWD 4000,0>>
	LSH	T0, -35		;MAKE CHARACTER RIGHT-JUSTIFIED
	TRZ	T0,40		;ACCEPT LOWER CASE ALSO
	CAIE	T0, "X"		;IS IT AN X?
	  JRST	PAUSE7
PAUSE8:	FUNCT	(EXIT.)	;YES, EXIT
PAUSE7:	CAIN	T0, "G"		;IS IT A G?
	  JRST	PAUSE4		;YES, CONTINUE
	CAIE	T0, "T"		;T FOR TRACE
	  JRST	PAUSE6	;NO, TRY AGAIN
	FUNCT	TRACE.,<0>	;YES DO A TRACE
	JRST	PAUSE6		;GET THE NEW RESPONSE
PAUSE4:	POP	P,L		;POP IN LIFO ORDER, DUMMY
	POP	P,T1
	POP	P, T0		;YES, RESTORE T0C A
	POPJ	P,		;EXIT




MESS1:	ASCII	"(' Type G to Continue, X to Exit, T To Trace.'/2H *,$)"
MESS2:	ASCII	"(A1)"
MESS3:	ASCII	"(' PAUSE',/(1X,14A5))"
MESS3S:	ASCII	"(1X,14A5)"
MESS4:	ASCII	"(' PAUSE ',O6)"
MESS4S:	ASCII	"(1X,O6)"
MESS5:	ASCII	"(' PAUSE')"

	RELOC
PSEFLG:	BLOCK	1

	END