Trailing-Edge
-
PDP-10 Archives
-
BB-Z759A-SM
-
cobol-source/putres.mac
There are 7 other files named putres.mac in the archive. Click here to see a list.
; UPD ID= 1325 on 7/15/83 at 12:53 PM by HOFFMAN
TITLE PUTRES FOR LIBOL V13
SUBTTL SET UP AND RESTORE USER PROGRAM'S FIXED PARAMETERS CHUCK MCCOMAS
SEARCH COPYRT
SALL
;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, 1983, 1984 BY DIGITAL EQUIPMENT CORPORATION
HISEG
.COPYRIGHT ;Put standard copyright statement in REL file
SALL
;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
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
;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
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)
PUSHJ PP,PUT$ ;SET UP THE DOLLAR SIGN FOR BIS.
JRST (TA) ;RETURN.
;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.
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
PUSHJ PP,PUT$ ;SET UP THE DOLLAR SIGN FOR BIS.
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,3
MOVSM PA,SBPSA.##
POP PP,PA
POPJ PP,
; THIS PROGRAM IS MESSING WITH THE "$" SO SAVE
; IT AWAY IN THE APPROPRIATE MESSAGE CHARACTERS
PUT$: 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