Google
 

Trailing-Edge - PDP-10 Archives - ap-c800d-sb - putres.mac
There are 7 other files named putres.mac in the archive. Click here to see a list.
; UPD ID= 1927 on 6/12/79 at 10:37 AM by N:<NIXON>
TITLE	PUTRES FOR LIBOL V12
SUBTTL	SET UP AND RESTORE USER PROGRAM'S FIXED PARAMETERS	 CHUCK MCCOMAS



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1974, 1979 BY DIGITAL EQUIPMENT CORPORATION


;V12********
;	5/29/79		/WCK	REVERSED ORDER OF OPERATIONS IN RESF.
;				SO THAT ERROR DETECTION OCCURS BEFORE
;				SWITCH TO CALLER'S CONTEXT.
;				ALSO ADDED ISBPS. TO INCREMENT SBPSA.
;V10********
;	5/10/75		/DBT	PUT IN TWO MORE ENTRIES TO DEAL WITH
;				$ FOR BIS
;DBT	6/25/75		PARAMETER TO PUTF./$ IS NOW ENTRY POINT ADDRESS
;	19-AUG-75	/ACK	TAKE OUT THE TWO ENTRIES TO DEAL WITH
;				$ FOR BIS
;**************

	SEARCH	LBLPRM

	%%LBLP==:%%LBLP
	BIS==:BIS


ENTRY	PUTF.
ENTRY	ISBPS.
ENTRY	RESF.
ENTRY	GETNM.

ENTRY	PUT$	;CALLED BY RESET TO STORE INITIAL "$" SIGN


;ASSIGNMENTS

TA=1		;TEMP
TB=2		;TEMP

PA=16		;ARGUMENT PTR
PP=17		;PDL PTR

EXTERNAL	PTR.69		;CONVERTS SIXBIT TO EBCDIC

	HISEG
	SALL
;PUTF. IS USED TO SAVE THE FIXED PARAMETERS
;(I.E., USES. THRU PR.) OF THE CALLING PROGRAM
;AND SUBSTITUTE THE FIXED PARAMETERS OF THE CURRENT PROGRAM

;CALLING SEQUENCE:
;	MOVEI	16,ADDR OF ENTRY POINT
;	PUSHJ	17,PUTF.

PUTF.:	PUSHJ	PP,@CIOTF.##		;GO SEE IF COBDDT WANTS TO DO ANYTHING.
	HRRZ	CH,1(PA)		;ADDRESS OF %FILES
	HRLI	TA,USES.##		;USES. TO %USES+FIXNUM
	HRRI	TA,FIXNUM+1(CH)		;  I.E., TO HOLDING AREA
	HRRZI	TB,FIXNUM##(CH)
	BLT	TA,FIXNUM-1(TB)

	HRLI	TA,1(CH)		;%USES TO USES.
	HRRI	TA,USES.
	HRRZI	TB,FILES.##
	BLT	TA,FIXNUM-1(TB)

;SAVE ENTRY POINT ADDR (IN RH) AND STACK POINTER (IN LH) IN SBPSA.
;PUT FORMER VALUE OF SBPSA. ON STACK IN PLACE OF CURRENT RETURN ADDRESS.
;THUS, A BACKWARD CHAIN IS CREATED, LINKING THE STACK FRAMES OF EACH OF
;THE CURRETNLY ACTIVATED PROGRAMS. SBPSA. HOLDS THE START OF THE CHAIN.
	HRRI	TA,(PA)
	HRLI	TA,(PP)
	EXCH	TA,SBPSA.##
	EXCH	TA,(PP)

IFN BIS,<PUSHJ	PP,PUT$>		;IF BIS, SET UP THE DOLLAR SIGN.

	JRST	(TA)			;RETURN.


;ISBPS. IS USED TO BUMP THE LEFT HALF OF SBPSA. 

;CALLING SEQUENCE:
;	PUSHJ	PP,ISBPS.

ISBPS.:	PUSH	PP,PA
	MOVS	PA,SBPSA.##
	ADDI	PA,2
	MOVSM	PA,SBPSA.##
	POP	PP,PA
	POPJ	PP,


;RESF. IS USED TO RESTORE THE FIXED PARAMETERS
;OF THE CALLING PROGRAM

;CALLING SEQUENCE:
;	MOVEI	16,ADDR OF LOCAL %FILES (I.E., %USES-1)
;	PUSHJ	17,RESF.

RESF.:	HLRZ	TA,SBPSA.##		;GET OLD PDL ADDRESS.
	CAIE	TA,-1(PP)		;IF WE'RE NOT AT THE SAME PLACE, COMPLAIN.
	JRST	[OUTSTR	[ASCIZ	/
?ATTEMPT TO RETURN FROM A SUBROUTINE IN WHICH SOME PERFORMS ARE STILL ACTIVE.
/]
		JRST	KILL.##]

;SWAP TO CALLER'S CONTEXT.

	HRLI	TA,FIXNUM+1(PA)		;%USES+FIXNUM TO USES.
	HRRI	TA,USES.		;  I.E., FROM HOLDING AREA
	HRRZI	TB,FILES.
	BLT	TA,FIXNUM-1(TB)

	POP	PP,TA			;GET RETURN ADDRESS.
	POP	PP,SBPSA.##		;ESTABLISH NEW END OF CHAIN
					;AT PREVIOUS STACK FRAME

IFN BIS,<PUSHJ	PP,PUT$>		;IF BIS, SET UP THE DOLLAR SIGN.
	JRST	(TA)			;RETURN.


PUT$:
IFN	BIS,<
	; THIS PROGRAM IS MESSING WITH THE "$" SO SAVE
	; IT AWAY IN THE APPROPRIATE MESSAGE CHARACTERS

	MOVE	CH,MONEY.##
	MOVEM	CH,E0.6##+E0.$		;SIXBIT "$" MESSAGE CHARACTER
	ADDI	CH,40			;CONVERT TO ASCII
	MOVEM	CH,E0.7##+E0.$		;ASCII "$" MESSAGE CHARACTER
	LDB	CH,PTR79.##		;CONVERT TO EBCDIC
	MOVEM	CH,E0.9##+E0.$		;EBCIDC "$" MESSAGE CHARACTER
>
	POPJ	PP,


;GETNM. IS USED BY COBDDT TO GET THE ADDRESSES OF %NM., %DT., %PR.

;CALLING SEQUENCE:
;	MOVEI	16,ADDR OF 3-WORD BLOCK TO RECEIVE ADDRESSES
;	PUSHJ	17,GETNM.

GETNM.:	HRLZI	TA,[EXP	%NM.##
			%DT.##
			%PR.##]
	HRRI	TA,(PA)
	BLT	TA,2(PA)
	POPJ	PP,

	END