cdc:nos2.source:nam5871:ovlcall
Table of Contents
OVLCALL
Table Of Contents
Source Code
- OVLCALL.txt
- *DECK OVLCALL
- IDENT OVLCALL
- *
- SST
- IPARAMS
- *#
- *1DC OVLCALL
- *
- * 1. PROC NAME AUTHOR DATE
- * OVLCALL E. GEE 76/08/04
- *
- * 2. FUNCTIONAL DESCRIPTION.
- *
- * THIS ROUTINE LOADS OVERLAYS AND TRANSFERS CONTROL TO THEM
- *
- * 3. METHOD USED.
- *
- * 3 WD PARM BLOCK SET UP TO LOAD THE OVERLAY.
- * LOADREQ MACRO IS USED TO CALL LDR
- * JUMP IS MADE TO ENTRY ADDRESS (PROVIED BY LDR) IN OVERLAY
- *
- * 4. ENTRY PARAMETERS.
- *
- * OVLNAME LEVEL NUMBERS OF THE REQUESTED OVERLAY
- * WITH OPTIONAL OVERSIZE FLAG
- * (VFD 47/0,1/F,6/L1,6/L2 WHERE )
- * (F = 1 IF OVERSIZE PRIMARY OVERLAY )
- * (L1 = PRIMARY LEVEL NUMBER, OR 1 IF SEC. )
- * (L2 = SECONDARY LEVEL NUMBER, OR 0 IF PRI.)
- *
- * 5. EXIT PARAMETERS.
- *
- * THE OVERLAY SHOULD BEGIN WITH A PRGM STATEMENT (INSTEAD OF A
- * PROC STATEMENT).
- *
- * AFTER THE OVERLAY HAS FINISHED EXECUTION, A JUMP MUST BE MADE
- * TO ADDRESS RJMAIN IN THIS ROUTINE, WHICH WILL THEN CAUSE A
- * RETURN TO WHERE THE OVERLAY WAS CALLED.
- *
- * 6. COMDECKS CALLED.
- * DUMPFLG INPARU MACDEF OVERLAY OVLSTAT
- * STATTAB
- *
- * 7. ROUTINES CALLED.
- * LOADREQ LOAD OVERLAY MACRO
- * OMSG ISSUE DAYFILE MESSAGE
- * OTIME GET SYSTEM RTIME
- * RDUMP DUMP FIELD LENGTH
- * XTRACE RECORD CALL
- *
- * 8. DAYFILE MESSAGES.
- *
- * *OVERLAY NOT LOADED* THIS DAYFILE MESSAGE IS ISSUED WHEN
- * THE OVERLAY THAT IS TO BE LOADED WILL OVERWRITE ANOTHER
- * OVERLAY STILL EXECUTING OR WHEN A FATAL ERROR OCCURRED
- * AND THE OVERLAY COULD NOT BE LOADED
- *
- * PARAMETERS REQUIRED FOR THE OVERLAY SHOULD BE PASSED THROUGH
- * LABELED COMMON BLOCK PARAMP (COMDCCK PARAMP) FOR PRIMARY
- * OVERLAYS AND LABELED COMMON BLOCK PARAMS (COMDECK PARAMS)
- * FOR SECONDARY OVERLAYS.
- * THE LEVELS OF THE OVERLAY SHOULD BE STORED IN LABELED COMMON
- * BLOCK OVERLAY (COMDECK OVERLAY).
- *
- * IT IS ASSUMED BY THIS ROUTINE THAT ALL OVERLAYS ARE IN THE
- * SYSTEM LIBRARY.
- *
- *
- * * * * * * * * * * * W A R N I N G * * * * * * * * * * * * * * *
- *
- * THE OVERLAYS ARE LOADED INTO FIXED SIZE BUFFERS (IN BLANK
- * COMMON). THEREFORE, THE SIZE OF THE OVERLAYS CANNOT EXCEED THE
- * SIZE OF THE BUFFERS.
- * NORMAL PRIMARY OVERLAY MUST NOT EXCEED PRIMARY
- *CALL OPSIZE
- * SECONDARY OVERLAY MUST NOT EXCEED SECONDARY
- *CALL OSSIZE
- * AND OVERSIZED PRIMARY MUST NOT EXCEED COMBINED
- *CALL OSIZE
- *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- *#
- EXT RDUMP DUMP FIELD LENGTH
- EXT OMSG ISSUE DAYFILE MESSAGE
- EXT OTIME
- EXT PRIBUF LOAD ORIGIN OF PRIMARY OVERLAYS
- EXT SECBUF LOAD ORIGIN OF SECONDARY OVERLAY
- EXT ENDOVL LIMIT OF OVERLAY AREA
- EXT XTRACE STORE RETURN ADDRESS
- ENTRY OVLCALL
- ENTRY RJMAIN
- RETADDR BSSZ 2 STORAGE FOR RETURN ADDRESSES
- ADDRPTR VFD 60/RETADDR PTR FOR STORING NEXT RETURN ADDR
- IPARAMS
- NOS EQU 1 NOS OPERATING SYSTEM
- *CALL MACDEF
- LOADREQ SPACE 4,7
- *** LOADREQ - CALL SYSTEM LOADER VIA PPU.
- *
- *
- * LOADREQ PLIST,RECALL
- *
- * ENTRY *PLIST* = FWA OF PARAMETER LIST.
- * CALLS SYS=.
- PURGMAC LOADREQ
- LOADREQ MACRO P,R,F
- IFC EQ, F ,2
- * NORMAL CALL
- SYSTEM LDV,R,P
- SKIP 8D
- SX1 P
- IFC EQ, F DATA ,2
- * LOAD OVERLAY AS DATA
- RJ =XLOD=
- SKIP 4
- IFC EQ, F CMM ,2
- * LOAD OVERLAY VIA CMM
- RJ =XCMM.LDV
- SKIP 1
- A ERR UNKNOWN PARAM - F
- ENDM
- *CALL INPARU
- 047300
- *CALL OVLSTAT
- 047500
- *CALL OVERLAY
- *CALL DUMPFLG
- *
- LEVELS BSSZ 2 LEVEL NUMBERS OF LOADED PRIMARY AND
- SECONDARY. LEVELS+1 = (VFD 12/7777B,48/0)
- IF LOADED PRIMARY IS OVERSIZED.
- *CALL STATTAB
- *
- DEBUG1 IFEQ DEBUG,1
- *
- * OVLFLAG USES BITS 0-2 (0 = RIGHTMOST) TO REPRESENT THE SIX
- * STATES OF OVERLAYS IN NIP.
- *
- * BIT
- * STATE 2 1 0 CONDITION
- *
- * 1 0 0 0 NO OVERLAYS LOADED
- * 2 1 0 0 PRIMARY OVERLAY LOADED ONLY
- * 3 0 1 1 PRIMARY AND SECONDARY LOADED, PRIMARY LAST
- * 4 1 1 0 PRIMARY AND SECONDARY LOADED, PRIMARY FIRST
- * 5 0 1 0 SECONDARY OVERLAY LOADED ONLY
- * 6 1 0 1 PRIMARY LOADED WITH NO ROOM FOR SECONDARY
- *
- *
- NAMEBUF BSSZ 200 BUFFER FOR STORING OVL PROGRAM NAMES
- BEGBUF EQU NAMEBUF FWA OF BUFFER
- ENDBUF EQU NAMEBUF+199 LWA+1 OF BUFFER
- CURRENT VFD 60/BEGBUF POINTER TO CURRENT WORD
- DEBUG1 ENDIF
- OVLCALL SUBR = ENTRY/EXIT
- *
- DEBUG5 IFEQ DEBUG,1
- SX1 XOVLC
- RJ XTRACE
- DEBUG5 ENDIF
- STAT1 IFEQ STAT,1
- SA1 ST$NOC INCREMENT TOTAL NUMBER OF CALLS TO OVLCALL
- SX6 1
- IX6 X6+X1
- SA6 ST$NOC
- STAT1 ENDIF
- * GET LEVEL NUMBERS
- MX0 -6 MASK FOR SECONDARY OVERLAY NUMBER L2
- SA1 OVLNAME L1, L2 AT RIGHTMOST 12 BITS
- BX5 -X0*X1 SECONDARY OVERLAY NUMBER L2 ONLY
- SB3 X5 (B3)= L2 OF CALLED OVERLAY
- SB1 1
- LX1 -6
- BX5 -X0*X1
- SB2 X5 (B2) = L1
- *
- * SAVE RETURN ADDRESS
- *
- SA3 ADDRPTR (X3)=CURRENT WD TO STORE RETURN ADDR
- SA2 OVLCALL X2 = JUMP INSTR BACK TO CALLING PROG
- BX6 X2
- SA6 X3 STORE RETURN ADDR IN RETADDR
- LX1 -7 OVERSIZE FLAG TO SIGN POSITION
- SX7 X3+B1 INCR RET ADDR PTR INTO NEXT WD
- SA7 A3
- *
- * SET UP PARAMETER WORD FOR CALLING OVERLAY
- *
- BX5 X1 KEEP OVERLAY SIZE FLAG
- LX1 1 L1, L2 OF OVERLAY IN LEFTMOST 12 BITS.
- MX4 12
- BX1 X4*X1 CLEAR REST OF THE WORD
- SA3 PARMOVL GET CALL PARAMETER CONSTANT
- BX6 X1+X3 ADD IN L1, L2
- SB4 B2-B1 OFFSET TO OVLSTAT TABLE FOR PRI OVERLAY
- SX4 PRIBUF FOR PRIMARY, X4 = FWA = PRIBUF
- IFEQ DEBUG,1
- SX2 ENDOVL X2 = LWA = ENDOVL (ASSUMING OVERSIZED)
- NG X5,OVLSEC1 OVERSIZED PRIMARY
- SX2 SECBUF FOR NORMAL PRIMARY, X2 = LWA = SECBUF
- ENDIF
- EQ B3,B0,OVLSEC1 NORMAL SIZE PRIMARY
- DEBUG4 IFEQ DEBUG,1
- BX4 X2 IF SECONDARY, X4 = FWA = SECBUF
- DEBUG4 ELSE
- SX4 SECBUF IF SECONDARY, X4 = FWA = SECBUF
- DEBUG4 ENDIF
- SB4 B3+PRINUM-1 OFFSET TO OVLSTAT TABLE FOR SEC OVERLAY
- IFEQ DEBUG,1,1
- SX2 ENDOVL IF SECONDARY, X2 = LWA = ENDOVL
- OVLSEC1 BSS 0
- BX6 X6+X4 SET FWA IN PARAMETER
- IFEQ DEBUG,1
- LX2 18
- BX6 X6+X2 SET LWA IN PARAMETER
- ENDIF
- *
- * B1, B2, B3, B4, X5, X6 MUST BE RESERVED DURING DEBUG/STAT
- *
- * B1 = 1
- * B2 = L1 (PRIMARY LEVEL NUMBER) FOR CURRENT REQUEST
- * B3 = L2 (SECONDARY LEVEL NUMBER) FOR CURRENT REQUEST
- * B4 = ENTRY INDEX FOR OVLNAMP TABLE
- * X5 NEGATIVE IF CURRENT REQUEST IS FOR OVERSIZED OVL.
- * X6 = PARAMETER WORD (OVLADR1) SET UP FOR CURRENT REQ.
- *
- DEBUG2 IFEQ DEBUG,1
- *
- * SET FLAG TO INDICATE OVERLAY LOADED
- *
- SX7 B1 OVERLAY-LOADED BIT
- SA2 OVLFLAG
- SX4 5 MASK TO DETERMINE IF PRI OVL LOADED
- PL X5,SMALLA
- NZ X2,ABTNIP IF LARGE, ERROR IF ANY LOADED
- BX7 X4 SET STATE
- SX4 B0 FAKE LATER CHECKING AND SETTING
- SMALLA NE B3,B0,SETSEC
- *
- * CHECK IF PRIMARY OVERLAY CAN BE LOADED
- *
- BX3 X2*X4 MASK OFF PRIMARY-OVERLAY-LOADED BITS
- NZ X3,ABTNIP IF ANOTHER PRI OVL STILL EXECUTING
- *
- * SET PRIMARY-OVERLAY-LOADED BIT
- *
- NZ X2,SETFLAG IF SECONDARY OVERLAY ALREADY LOADED
- BX7 X4-X7 SET BIT 2 TO INDICATE PRI OVL LOADED
- EQ SETFLAG
- *
- * CHECK IF SECONDARY OVERLAY CAN BE LOADED
- *
- SETSEC BX3 X2-X4
- ZR X3,ABTNIP NO ROOM FOR SECONDARY
- LX7 1 SHIFT FOR CHECKING SEC-OVL-LOADED BIT
- BX3 X2*X7 MASK OFF SECONDARY-OVERLAY-LOADED BIT
- NZ X3,ABTNIP IF ANOTHER SEC OVL STILL EXECUTING
- *
- * SET SECONDARY-OVERLAY-LOADED BIT
- *
- SETFLAG BX7 X7+X2 SET BIT TO INDICATE OVL LOADED
- SA7 OVLFLAG
- DEBUG2 ENDIF
- * 043800
- * STATISTICS COUNT IF STAT IS ON 043900
- * 044000
- IFNE STAT,1,1
- IFEQ DEBUG,1
- SA1 OVLNAMP+B4
- MX0 -18 MASK FOR CALL COUNT
- BX7 -X0*X1 (X7)=OLD CALL COUNT
- BX4 X0*X1 (X4) = REST OF WORD = OVERLAY NAME
- ENDIF
- IFEQ STAT,1
- SX7 X7+B1 INCREMENT CALL COUNT
- BX7 -X0*X7 PREVENT OVERFLOW
- BX7 X7+X4 RESTORE STAT ENTRY
- SA7 A1
- ENDIF
- IFEQ DEBUG,1
- SA2 CURRENT (X2)=CURRENT WORD TO STORE OVLNAME
- BX7 X4 X7 = OVERLAY NAME
- SA3 OVLCALLX (X3)=RETURN ADDR
- SA7 X2 SET OVERLAY NAME
- LX7 X3
- SA7 X2+B1 SET RETURN ADDR
- SB6 A7+B1 INCR CURRENT ADDR
- SB5 ENDBUF
- LT B6,B5,NOTEND IF CURRENT GR ENDBUF
- SB6 BEGBUF SET CURRENT TO BEGBUF
- NOTEND SX7 B6
- SA7 A2
- ENDIF
- *
- * CHECK IF OVERLAY ALREADY LOADED
- *
- SA2 LEVELS LOADED PRIMARY OVERLAY
- SA3 A2+B1 LOADED SECONDARY OVERLAY
- EQ B3,B0,PRI CURRENT IS PRIMARY OVERLAY
- BX2 X3 CURRENT IS SECONDARY OVERLAY
- PRI BX4 X2-X6
- MX0 12
- BX4 X0*X4 LEVEL NUMBERS COMPARED
- ZR X4,JUMPX CURRENT IS SAME TO THE LOADED
- BX4 X3-X0 CHECK OVERSIZE FLAG IN X3
- MX7 0
- NZ X4,OVLSEC4 LOADED PRIMARY IS NORMAL IF ANY
- SA7 A2 CLEAR PRIMARY IF LOADED IS OVERSIZED
- SA7 A3 CLEAR OVERSIZE FLAG
- OVLSEC4 PL X5,OVLSEC3 CURRENT IS NORMAL SIZE LOAD
- BX7 X0 FLAG IN LEVELS+1 IF CURRENT IS OVERSIZED
- SA7 A3
- OVLSEC3 SA6 OVLADR1 SET UP OVERLAY 2ND PARAMETER WORD
- MX0 42 MASK FOR OVLNAME
- SA1 B4+OVLNAMP
- BX7 X0*X1 X7 = OVERLAY NAME
- SA7 A6+B1 SET UP 3RD PARAMETER FOR LOADER
- STAT2 IFEQ STAT,1
- SA1 STIMEP PARAMETER BLOCK FOR CALLING OTIME
- RJ OTIME GET RTIME VALUE BEFORE CALL
- STAT2 ENDIF
- *
- * LOAD OVERLAY
- *
- *IF,-DEF,MSS
- LOADREQ OVLADR,RCL
- *ENDIF
- *IF,DEF,MSS FOR CDC INTERNAL USE ONLY
- SA2 OVLADR2 OVLNAME IN X2
- SA3 OVLADR1 EXTRACT THE LEVELS
- MX4 12
- BX3 X4*X3 L1/L2 IS THE FIRST 12 BITS
- LX3 12
- BX1 X2+X3 OVLNAME/L1/L2 WORD
- RJ =XFOL.LOV
- MX4 42
- SA2 OVLADR1 STORE FWA INTO PARAM BLOCK
- BX2 X4*X2
- SX3 B7 RETURNED FWA
- BX7 X2+X3
- SA7 A2
- *ENDIF FOR CDC INTERNAL USE ONLY
- STAT3 IFEQ STAT,1
- SA1 ST$NOL INCREMENT TOTAL NUMBER OF OVERLAY LOADS
- SX6 1
- IX6 X6+X1
- SA6 ST$NOL
- SA1 ETIMEP PARAMETER BLOCK FOR CALLING OTIME
- RJ OTIME GET RTIME VALUE AFTER CALL
- SA1 STIME STARTING RTIME VALUE
- MX0 24D MASK FOR RTIME MILLESECOND VALUE
- BX1 -X0*X1 CLEAR SECONDS FIELD
- SA2 ETIME ENDING RTIME VALUE
- BX2 -X0*X2 CLEAR SECONDS FIELD
- IX6 X2-X1 ELAPSED TIME FOR SWAPIN
- SA1 ST$LOL LARGEST TIME SPENT IN OVLCALL
- IX5 X1-X6 DETERMINE IF LATEST TIME INTERVAL IS LARGER
- PL X5,OVLSEC5 IF PREVIOUS TIME INTERVAL WAS LARGER
- SA6 ST$LOL SAVE NEW LARGEST TIME INTERVAL
- OVLSEC5 SA3 ST$TOL PREVIOUS CUMULATIVE VALUE
- IX6 X3+X6 NEW CUMULATIVE VALUE
- SA6 ST$TOL
- STAT3 ENDIF
- SX7 B0
- SA7 OVLNAME CLEAR OVLNAME IN OVERLAY COMMON BLK
- SA2 OVLADR1 X2 = RETURNED PARAMETER WORD
- MX4 6
- BX7 X2
- LX4 54
- BX4 X4*X2 SECONDARY LEVEL NUMBER OF THE LOAD
- SB5 B0
- ZR X4,SVLVL PRIMARY
- SB5 1 SECONDARY
- SVLVL SA7 LEVELS+B5 SAVE LOADED PARAMETER WORD
- JUMPX SB6 X2 ENTRY POINT ADDRESS IN B6
- * JUMP TO OVERLAY
- *
- JP B6 ENTRY POINT ADDR IN B6
- *
- * RETURN TO CALLING PROGRAM
- *
- RJMAIN BSS 0
- DEBUG3 IFEQ DEBUG,1
- *
- * CLEAR FLAG OF LAST OVERLAY LOADED
- *
- SX6 B0 USED TO CLEAR OVLFLAG
- SA1 OVLFLAG
- LX1 57 CHECK PRIMARY-OVL-LOADED-FIRST BIT
- NG X1,PRIFIRST IF PRI OVL LOADED FIRST
- LX1 2 CHECK IF PRI OVL ALSO LOADED
- PL X1,CLRFLAG IF ONLY SEC OVL LOADED
- SX6 2 CLEAR PRI-OVL-LOADED BIT
- EQ CLRFLAG
- PRIFIRST LX1 1 CHECK IF SEC OVL ALSO LOADED
- PL X1,CLRFLAG IF ONLY PRI OVL LOADED
- SX6 4 CLEAR SEC-OVL-LOADED BIT
- CLRFLAG SA6 A1
- DEBUG3 ENDIF
- SA1 ADDRPTR X1 = ADDR FOR STORING NEXT RET ADDR
- SX6 X1-1 X6 = ADDR CONTAINING CURRENT RET ADDR
- SA6 A1
- SB2 X6
- JP B2 JUMP TO RETADDR TO RETURN
- IFEQ DEBUG,1
- ABTNIP SX6 DOVLCAL1 REASON CODE FOR DUMPING FL
- SA6 DMPFLG
- RJ RDUMP DUMP NIP-S FIELD LENGTH
- SA1 MSGADDR
- RJ OMSG ISSUE DAYFILE MESSAGE
- ABORT ABORT SINCE OVERLAY WAS NOT LOADED
- MSG DIS ,*OVERLAY NOT LOADED*
- MSGADDR VFD 60/MSG PTR TO DAYFILE MESSAGE
- BSSZ 1
- XOVLC DATA L*OVLCL*
- TEMP BSS 1
- ENDIF
- STAT4 IFEQ STAT,1
- EXT OTIME
- STIMEP VFD 60D/STIME
- ETIMEP VFD 60D/ETIME
- STIME BSS 1 START TIME FOR COMPARING SWAPIN TIME DELAY
- ETIME BSS 1 END TIME FOR COMPARING SWAPIN TIME DELAY
- STAT4 ENDIF
- END
cdc/nos2.source/nam5871/ovlcall.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator