Google
 

Trailing-Edge - PDP-10 Archives - BB-D480C-SB_1981 - forxit.mac
There are 13 other files named forxit.mac in the archive. Click here to see a list.
	SEARCH	FORPRM
	TV	FORXIT  NORMAL AND ERROR EXIT,6(2031)

;COPYRIGHT (C) 1981  BY  DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

;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.

COMMENT \

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

1464	DAW	14-May-81
	Error messages.

1523	JLC	03-Jul-81
	Quiet exit flag, set via a FOROP call.

1571	DAW	31-Jul-81
	Set F to I.FLAGS at %ABORT.

1656	DAW	2-Sep-81
	Get rid of magic numbers.

1760	JLC	5-Oct-81	Q10-6522
	Changed elapsed time calc to use system uptime instead of
	time of day.

2007	JLC	16-Oct-81
	Fix runtime and elapsed time calcs.

2012	JLC	19-Oct-81
	Changed elapsed time calcs yet again.

2025	JLC	26-Oct-81
	Fixed elasped time calcs on -10 yet again.

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

\

	FSRCH
	SEGMENT	CODE

	ENTRY	EXIT%,%ABORT
	EXTERN	%TRACE,%EXIT1,%APRCT,%APRTXT,%FSAVE
	EXTERN	I.FLAGS,I.RUNTM,I.DAYTM
	EXTERN	%CRLF
	INTERN	%QUIET

%ABORT:	XMOVEI	L,1+[EXP 0,0]	;No args
;	TRN			;Junk instruction to tell %TRACE
				; not to trace this one call.
	MOVE	F,I.FLAGS	;Get initial flags
	PUSHJ	P,%TRACE	;TYPE TRACEBACK
	JRST	EXIT1

	SIXBIT	/EXIT./
EXIT%:	PUSHJ	P,%FSAVE	;SAVE USER'S ACS
EXIT1:	PUSHJ	P,%EXIT1	;CLOSE ALL FILES AND CLEAN UP

IF10,<	OUTSTR	%CRLF >
IF20,<	HRROI	T1,%CRLF
	PSOUT%  >

	SKIPE	%QUIET		;QUIET EXIT DESIRED?
	 JRST	QUIXIT		;YES. BUT DON'T SKIP ERROR TYPOUT

IF20,<
	MOVEI	T1,.FHSLF	;GET RUNTIME
	RUNTM%
	SUBM	T1,I.RUNTM	;SUBTRACT INITIAL RUNTIME, GIVING USED RUNTIME
	TIME%			;GET CURRENT UPTIME IN MILLISECS
	SUB	T1,I.DAYTM	;GET DIFFERENCE
>;END IF20

IF10,<
	SETZ	T1,		;GET RUNTIME
	RUNTIM	T1,
	SUBM	T1,I.RUNTM	;SUBTRACT INITIAL RUNTIME, GIVING USED RUNTIME
	MOVE	T1,[%CNSUP]	;GET UPTIME IN JIFFIES
	GETTAB	T1,
	  SETZ	T1,
	MULI	T1,^D1000		;GET UPTIME IN JIFFIES*1000
	MOVE	T3,[%CNTIC]	;GET JIFFIES/SEC
	GETTAB	T3,
	 MOVEI	T3,^D60		;USE 60 IF NOT THERE
	ADDI	T1,-1(T3)	;ROUND UP
	DIVI	T1,(T3)		;GET UPTIME IN MILLISECS
	SUB	T1,I.DAYTM	;SUBTRACT OLD TIME
>;END IF10

	
;	ERR	(TIM,,CPU time $Y   Elapsed time $Y,<I.RUNTM,T1>)
	$ECALL	TIM		;Print CPU time
;TYPE APR ERROR SUMMARY

QUIXIT:	MOVSI	T1,-<.ETNUM>	;SET TO GO THROUGH TABLE AGAIN
SUMLP:	SKIPN	T2,%APRCT(T1)	;GET ERROR COUNT
	  JRST	SUMNXT		;ZERO, GO TO NEXT
	MOVEI	T3,[0]		;ASSUME NOT PLURAL
	CAIE	T2,1		;SINGLE ERROR?
	  MOVEI	T3,[ASCIZ /s/]	;NO, PUT -S ON END OF TEXT
	MOVE	T4,%APRTXT(T1)	;Get address of string to print
;	ERR	(SM1,,$D$3T$A$A,<T2,%APRTXT(T1),T3>)
	$ECALL	SM1
SUMNXT:	AOBJN	T1,SUMLP	;TYPE WHOLE TABLE

IF20,<
	HALTF%			;QUIT
	JRST	.-1		;AND STAY THAT WAY
>

IF10,<
	EXIT			;QUIT AND STAY THAT WAY
>

	SEGMENT	DATA

%QUIET:	BLOCK	1		;SET FOR QUIET EXIT

	PURGE	$SEG$
	END