Google
 

Trailing-Edge - PDP-10 Archives - BB-H506D-SM_1983 - cobol/source/putres.mac
There are 7 other files named putres.mac in the archive. Click here to see a list.
; UPD ID= 3555 on 5/15/81 at 9:48 PM by NIXON                           
TITLE	PUTRES FOR LIBOL V12B
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, 1981 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
IFN ANS74,<
	LDB	TA,[POINT 12,%COBVR##(CH),17]	;GET THE VERSION NO.
	CAIGE	TA,1202			;INCASE ITS A 12A SUBPROGRAM
	JRST	PUTF.A			;IT WAS
>
	HRLZI	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)

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

PUTF.B:	HRRZI	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.


IFN ANS74,<
;Same as PUTF. but for FIXNUM as it was in 12A.

PUTF.A:	HRLZI	TA,USES.		;USES. TO %USES+FIXNMA
	HRRI	TA,FIXNMA+1(CH)		;  I.E., TO HOLDING AREA
	HRRZI	TB,FIXNMA##(CH)
	BLT	TA,FIXNMA-1(TB)

	HRLZI	TA,1(CH)		;%USES TO USES.
	HRRI	TA,USES.
	HRRZI	TB,FILES.
	BLT	TA,FIXNMA-1(TB)
	JRST	PUTF.B			;REJOIN MAINLINE CODE
>
;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.

IFN ANS74,<
	LDB	TA,[POINT 12,%COBVR(PA),17]	;GET THE VERSION NO.
	CAIGE	TA,1202			;INCASE ITS A 12A SUBPROGRAM
	JRST	RESF.A			;IT WAS
>
	HRLZI	TA,FIXNUM+1(PA)		;%USES+FIXNUM TO USES.
	HRRI	TA,USES.		;  I.E., FROM HOLDING AREA
	HRRZI	TB,FILES.
	BLT	TA,FIXNUM-1(TB)

RESF.B:	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.

IFN ANS74,<
;Same as RESF. but for FIXNUM as it was in 12A.

RESF.A:	HRLZI	TA,FIXNMA+1(PA)		;%USES+FIXNMA TO USES.
	HRRI	TA,USES.		;  I.E., FROM HOLDING AREA
	HRRZI	TB,FILES.
	BLT	TA,FIXNMA-1(TB)
	JRST	RESF.B			;RETURN TO MAINLINE CODE
>
;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,

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.$		;EBCDIC "$" 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