User Tools

Site Tools


cdc:nos2.source:nam5871:ovlcall

OVLCALL

Table Of Contents

Source Code

OVLCALL.txt
  1. *DECK OVLCALL
  2. IDENT OVLCALL
  3. *
  4. SST
  5. IPARAMS
  6. *#
  7. *1DC OVLCALL
  8. *
  9. * 1. PROC NAME AUTHOR DATE
  10. * OVLCALL E. GEE 76/08/04
  11. *
  12. * 2. FUNCTIONAL DESCRIPTION.
  13. *
  14. * THIS ROUTINE LOADS OVERLAYS AND TRANSFERS CONTROL TO THEM
  15. *
  16. * 3. METHOD USED.
  17. *
  18. * 3 WD PARM BLOCK SET UP TO LOAD THE OVERLAY.
  19. * LOADREQ MACRO IS USED TO CALL LDR
  20. * JUMP IS MADE TO ENTRY ADDRESS (PROVIED BY LDR) IN OVERLAY
  21. *
  22. * 4. ENTRY PARAMETERS.
  23. *
  24. * OVLNAME LEVEL NUMBERS OF THE REQUESTED OVERLAY
  25. * WITH OPTIONAL OVERSIZE FLAG
  26. * (VFD 47/0,1/F,6/L1,6/L2 WHERE )
  27. * (F = 1 IF OVERSIZE PRIMARY OVERLAY )
  28. * (L1 = PRIMARY LEVEL NUMBER, OR 1 IF SEC. )
  29. * (L2 = SECONDARY LEVEL NUMBER, OR 0 IF PRI.)
  30. *
  31. * 5. EXIT PARAMETERS.
  32. *
  33. * THE OVERLAY SHOULD BEGIN WITH A PRGM STATEMENT (INSTEAD OF A
  34. * PROC STATEMENT).
  35. *
  36. * AFTER THE OVERLAY HAS FINISHED EXECUTION, A JUMP MUST BE MADE
  37. * TO ADDRESS RJMAIN IN THIS ROUTINE, WHICH WILL THEN CAUSE A
  38. * RETURN TO WHERE THE OVERLAY WAS CALLED.
  39. *
  40. * 6. COMDECKS CALLED.
  41. * DUMPFLG INPARU MACDEF OVERLAY OVLSTAT
  42. * STATTAB
  43. *
  44. * 7. ROUTINES CALLED.
  45. * LOADREQ LOAD OVERLAY MACRO
  46. * OMSG ISSUE DAYFILE MESSAGE
  47. * OTIME GET SYSTEM RTIME
  48. * RDUMP DUMP FIELD LENGTH
  49. * XTRACE RECORD CALL
  50. *
  51. * 8. DAYFILE MESSAGES.
  52. *
  53. * *OVERLAY NOT LOADED* THIS DAYFILE MESSAGE IS ISSUED WHEN
  54. * THE OVERLAY THAT IS TO BE LOADED WILL OVERWRITE ANOTHER
  55. * OVERLAY STILL EXECUTING OR WHEN A FATAL ERROR OCCURRED
  56. * AND THE OVERLAY COULD NOT BE LOADED
  57. *
  58. * PARAMETERS REQUIRED FOR THE OVERLAY SHOULD BE PASSED THROUGH
  59. * LABELED COMMON BLOCK PARAMP (COMDCCK PARAMP) FOR PRIMARY
  60. * OVERLAYS AND LABELED COMMON BLOCK PARAMS (COMDECK PARAMS)
  61. * FOR SECONDARY OVERLAYS.
  62. * THE LEVELS OF THE OVERLAY SHOULD BE STORED IN LABELED COMMON
  63. * BLOCK OVERLAY (COMDECK OVERLAY).
  64. *
  65. * IT IS ASSUMED BY THIS ROUTINE THAT ALL OVERLAYS ARE IN THE
  66. * SYSTEM LIBRARY.
  67. *
  68. *
  69. * * * * * * * * * * * W A R N I N G * * * * * * * * * * * * * * *
  70. *
  71. * THE OVERLAYS ARE LOADED INTO FIXED SIZE BUFFERS (IN BLANK
  72. * COMMON). THEREFORE, THE SIZE OF THE OVERLAYS CANNOT EXCEED THE
  73. * SIZE OF THE BUFFERS.
  74. * NORMAL PRIMARY OVERLAY MUST NOT EXCEED PRIMARY
  75. *CALL OPSIZE
  76. * SECONDARY OVERLAY MUST NOT EXCEED SECONDARY
  77. *CALL OSSIZE
  78. * AND OVERSIZED PRIMARY MUST NOT EXCEED COMBINED
  79. *CALL OSIZE
  80. *
  81. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  82. *
  83. *#
  84.  
  85. EXT RDUMP DUMP FIELD LENGTH
  86. EXT OMSG ISSUE DAYFILE MESSAGE
  87. EXT OTIME
  88. EXT PRIBUF LOAD ORIGIN OF PRIMARY OVERLAYS
  89. EXT SECBUF LOAD ORIGIN OF SECONDARY OVERLAY
  90. EXT ENDOVL LIMIT OF OVERLAY AREA
  91. EXT XTRACE STORE RETURN ADDRESS
  92. ENTRY OVLCALL
  93. ENTRY RJMAIN
  94. RETADDR BSSZ 2 STORAGE FOR RETURN ADDRESSES
  95. ADDRPTR VFD 60/RETADDR PTR FOR STORING NEXT RETURN ADDR
  96.  
  97. IPARAMS
  98. NOS EQU 1 NOS OPERATING SYSTEM
  99. *CALL MACDEF
  100. LOADREQ SPACE 4,7
  101. *** LOADREQ - CALL SYSTEM LOADER VIA PPU.
  102. *
  103. *
  104. * LOADREQ PLIST,RECALL
  105. *
  106. * ENTRY *PLIST* = FWA OF PARAMETER LIST.
  107. * CALLS SYS=.
  108.  
  109.  
  110. PURGMAC LOADREQ
  111.  
  112. LOADREQ MACRO P,R,F
  113. IFC EQ, F ,2
  114. * NORMAL CALL
  115. SYSTEM LDV,R,P
  116. SKIP 8D
  117. SX1 P
  118. IFC EQ, F DATA ,2
  119. * LOAD OVERLAY AS DATA
  120. RJ =XLOD=
  121. SKIP 4
  122. IFC EQ, F CMM ,2
  123. * LOAD OVERLAY VIA CMM
  124. RJ =XCMM.LDV
  125. SKIP 1
  126. A ERR UNKNOWN PARAM - F
  127. ENDM
  128. *CALL INPARU
  129.  
  130. 047300
  131. *CALL OVLSTAT
  132. 047500
  133. *CALL OVERLAY
  134. *CALL DUMPFLG
  135. *
  136. LEVELS BSSZ 2 LEVEL NUMBERS OF LOADED PRIMARY AND
  137. SECONDARY. LEVELS+1 = (VFD 12/7777B,48/0)
  138. IF LOADED PRIMARY IS OVERSIZED.
  139. *CALL STATTAB
  140. *
  141. DEBUG1 IFEQ DEBUG,1
  142. *
  143. * OVLFLAG USES BITS 0-2 (0 = RIGHTMOST) TO REPRESENT THE SIX
  144. * STATES OF OVERLAYS IN NIP.
  145. *
  146. * BIT
  147. * STATE 2 1 0 CONDITION
  148. *
  149. * 1 0 0 0 NO OVERLAYS LOADED
  150. * 2 1 0 0 PRIMARY OVERLAY LOADED ONLY
  151. * 3 0 1 1 PRIMARY AND SECONDARY LOADED, PRIMARY LAST
  152. * 4 1 1 0 PRIMARY AND SECONDARY LOADED, PRIMARY FIRST
  153. * 5 0 1 0 SECONDARY OVERLAY LOADED ONLY
  154. * 6 1 0 1 PRIMARY LOADED WITH NO ROOM FOR SECONDARY
  155. *
  156. *
  157. NAMEBUF BSSZ 200 BUFFER FOR STORING OVL PROGRAM NAMES
  158. BEGBUF EQU NAMEBUF FWA OF BUFFER
  159. ENDBUF EQU NAMEBUF+199 LWA+1 OF BUFFER
  160. CURRENT VFD 60/BEGBUF POINTER TO CURRENT WORD
  161. DEBUG1 ENDIF
  162.  
  163. OVLCALL SUBR = ENTRY/EXIT
  164. *
  165.  
  166. DEBUG5 IFEQ DEBUG,1
  167. SX1 XOVLC
  168. RJ XTRACE
  169. DEBUG5 ENDIF
  170.  
  171. STAT1 IFEQ STAT,1
  172. SA1 ST$NOC INCREMENT TOTAL NUMBER OF CALLS TO OVLCALL
  173. SX6 1
  174. IX6 X6+X1
  175. SA6 ST$NOC
  176. STAT1 ENDIF
  177.  
  178.  
  179. * GET LEVEL NUMBERS
  180.  
  181. MX0 -6 MASK FOR SECONDARY OVERLAY NUMBER L2
  182. SA1 OVLNAME L1, L2 AT RIGHTMOST 12 BITS
  183. BX5 -X0*X1 SECONDARY OVERLAY NUMBER L2 ONLY
  184. SB3 X5 (B3)= L2 OF CALLED OVERLAY
  185. SB1 1
  186. LX1 -6
  187. BX5 -X0*X1
  188. SB2 X5 (B2) = L1
  189. *
  190. * SAVE RETURN ADDRESS
  191. *
  192. SA3 ADDRPTR (X3)=CURRENT WD TO STORE RETURN ADDR
  193. SA2 OVLCALL X2 = JUMP INSTR BACK TO CALLING PROG
  194. BX6 X2
  195. SA6 X3 STORE RETURN ADDR IN RETADDR
  196. LX1 -7 OVERSIZE FLAG TO SIGN POSITION
  197. SX7 X3+B1 INCR RET ADDR PTR INTO NEXT WD
  198. SA7 A3
  199. *
  200. * SET UP PARAMETER WORD FOR CALLING OVERLAY
  201. *
  202. BX5 X1 KEEP OVERLAY SIZE FLAG
  203. LX1 1 L1, L2 OF OVERLAY IN LEFTMOST 12 BITS.
  204. MX4 12
  205. BX1 X4*X1 CLEAR REST OF THE WORD
  206. SA3 PARMOVL GET CALL PARAMETER CONSTANT
  207. BX6 X1+X3 ADD IN L1, L2
  208. SB4 B2-B1 OFFSET TO OVLSTAT TABLE FOR PRI OVERLAY
  209. SX4 PRIBUF FOR PRIMARY, X4 = FWA = PRIBUF
  210. IFEQ DEBUG,1
  211. SX2 ENDOVL X2 = LWA = ENDOVL (ASSUMING OVERSIZED)
  212. NG X5,OVLSEC1 OVERSIZED PRIMARY
  213. SX2 SECBUF FOR NORMAL PRIMARY, X2 = LWA = SECBUF
  214. ENDIF
  215. EQ B3,B0,OVLSEC1 NORMAL SIZE PRIMARY
  216. DEBUG4 IFEQ DEBUG,1
  217. BX4 X2 IF SECONDARY, X4 = FWA = SECBUF
  218. DEBUG4 ELSE
  219. SX4 SECBUF IF SECONDARY, X4 = FWA = SECBUF
  220. DEBUG4 ENDIF
  221. SB4 B3+PRINUM-1 OFFSET TO OVLSTAT TABLE FOR SEC OVERLAY
  222. IFEQ DEBUG,1,1
  223. SX2 ENDOVL IF SECONDARY, X2 = LWA = ENDOVL
  224. OVLSEC1 BSS 0
  225. BX6 X6+X4 SET FWA IN PARAMETER
  226. IFEQ DEBUG,1
  227. LX2 18
  228. BX6 X6+X2 SET LWA IN PARAMETER
  229. ENDIF
  230. *
  231. * B1, B2, B3, B4, X5, X6 MUST BE RESERVED DURING DEBUG/STAT
  232. *
  233. * B1 = 1
  234. * B2 = L1 (PRIMARY LEVEL NUMBER) FOR CURRENT REQUEST
  235. * B3 = L2 (SECONDARY LEVEL NUMBER) FOR CURRENT REQUEST
  236. * B4 = ENTRY INDEX FOR OVLNAMP TABLE
  237. * X5 NEGATIVE IF CURRENT REQUEST IS FOR OVERSIZED OVL.
  238. * X6 = PARAMETER WORD (OVLADR1) SET UP FOR CURRENT REQ.
  239. *
  240.  
  241. DEBUG2 IFEQ DEBUG,1
  242. *
  243. * SET FLAG TO INDICATE OVERLAY LOADED
  244. *
  245. SX7 B1 OVERLAY-LOADED BIT
  246. SA2 OVLFLAG
  247. SX4 5 MASK TO DETERMINE IF PRI OVL LOADED
  248. PL X5,SMALLA
  249. NZ X2,ABTNIP IF LARGE, ERROR IF ANY LOADED
  250. BX7 X4 SET STATE
  251. SX4 B0 FAKE LATER CHECKING AND SETTING
  252.  
  253. SMALLA NE B3,B0,SETSEC
  254. *
  255. * CHECK IF PRIMARY OVERLAY CAN BE LOADED
  256. *
  257. BX3 X2*X4 MASK OFF PRIMARY-OVERLAY-LOADED BITS
  258. NZ X3,ABTNIP IF ANOTHER PRI OVL STILL EXECUTING
  259. *
  260. * SET PRIMARY-OVERLAY-LOADED BIT
  261. *
  262. NZ X2,SETFLAG IF SECONDARY OVERLAY ALREADY LOADED
  263. BX7 X4-X7 SET BIT 2 TO INDICATE PRI OVL LOADED
  264. EQ SETFLAG
  265. *
  266. * CHECK IF SECONDARY OVERLAY CAN BE LOADED
  267. *
  268. SETSEC BX3 X2-X4
  269. ZR X3,ABTNIP NO ROOM FOR SECONDARY
  270. LX7 1 SHIFT FOR CHECKING SEC-OVL-LOADED BIT
  271. BX3 X2*X7 MASK OFF SECONDARY-OVERLAY-LOADED BIT
  272. NZ X3,ABTNIP IF ANOTHER SEC OVL STILL EXECUTING
  273. *
  274. * SET SECONDARY-OVERLAY-LOADED BIT
  275. *
  276. SETFLAG BX7 X7+X2 SET BIT TO INDICATE OVL LOADED
  277. SA7 OVLFLAG
  278. DEBUG2 ENDIF
  279. * 043800
  280. * STATISTICS COUNT IF STAT IS ON 043900
  281. * 044000
  282.  
  283. IFNE STAT,1,1
  284. IFEQ DEBUG,1
  285. SA1 OVLNAMP+B4
  286. MX0 -18 MASK FOR CALL COUNT
  287. BX7 -X0*X1 (X7)=OLD CALL COUNT
  288. BX4 X0*X1 (X4) = REST OF WORD = OVERLAY NAME
  289. ENDIF
  290. IFEQ STAT,1
  291. SX7 X7+B1 INCREMENT CALL COUNT
  292. BX7 -X0*X7 PREVENT OVERFLOW
  293. BX7 X7+X4 RESTORE STAT ENTRY
  294. SA7 A1
  295. ENDIF
  296. IFEQ DEBUG,1
  297. SA2 CURRENT (X2)=CURRENT WORD TO STORE OVLNAME
  298. BX7 X4 X7 = OVERLAY NAME
  299. SA3 OVLCALLX (X3)=RETURN ADDR
  300. SA7 X2 SET OVERLAY NAME
  301. LX7 X3
  302. SA7 X2+B1 SET RETURN ADDR
  303. SB6 A7+B1 INCR CURRENT ADDR
  304. SB5 ENDBUF
  305. LT B6,B5,NOTEND IF CURRENT GR ENDBUF
  306. SB6 BEGBUF SET CURRENT TO BEGBUF
  307. NOTEND SX7 B6
  308. SA7 A2
  309. ENDIF
  310. *
  311. * CHECK IF OVERLAY ALREADY LOADED
  312. *
  313. SA2 LEVELS LOADED PRIMARY OVERLAY
  314. SA3 A2+B1 LOADED SECONDARY OVERLAY
  315. EQ B3,B0,PRI CURRENT IS PRIMARY OVERLAY
  316. BX2 X3 CURRENT IS SECONDARY OVERLAY
  317. PRI BX4 X2-X6
  318. MX0 12
  319. BX4 X0*X4 LEVEL NUMBERS COMPARED
  320. ZR X4,JUMPX CURRENT IS SAME TO THE LOADED
  321. BX4 X3-X0 CHECK OVERSIZE FLAG IN X3
  322. MX7 0
  323. NZ X4,OVLSEC4 LOADED PRIMARY IS NORMAL IF ANY
  324. SA7 A2 CLEAR PRIMARY IF LOADED IS OVERSIZED
  325. SA7 A3 CLEAR OVERSIZE FLAG
  326. OVLSEC4 PL X5,OVLSEC3 CURRENT IS NORMAL SIZE LOAD
  327. BX7 X0 FLAG IN LEVELS+1 IF CURRENT IS OVERSIZED
  328. SA7 A3
  329. OVLSEC3 SA6 OVLADR1 SET UP OVERLAY 2ND PARAMETER WORD
  330. MX0 42 MASK FOR OVLNAME
  331. SA1 B4+OVLNAMP
  332. BX7 X0*X1 X7 = OVERLAY NAME
  333. SA7 A6+B1 SET UP 3RD PARAMETER FOR LOADER
  334.  
  335. STAT2 IFEQ STAT,1
  336. SA1 STIMEP PARAMETER BLOCK FOR CALLING OTIME
  337. RJ OTIME GET RTIME VALUE BEFORE CALL
  338. STAT2 ENDIF
  339.  
  340. *
  341. * LOAD OVERLAY
  342. *
  343. *IF,-DEF,MSS
  344. LOADREQ OVLADR,RCL
  345. *ENDIF
  346. *IF,DEF,MSS FOR CDC INTERNAL USE ONLY
  347. SA2 OVLADR2 OVLNAME IN X2
  348. SA3 OVLADR1 EXTRACT THE LEVELS
  349. MX4 12
  350. BX3 X4*X3 L1/L2 IS THE FIRST 12 BITS
  351. LX3 12
  352. BX1 X2+X3 OVLNAME/L1/L2 WORD
  353. RJ =XFOL.LOV
  354. MX4 42
  355. SA2 OVLADR1 STORE FWA INTO PARAM BLOCK
  356. BX2 X4*X2
  357. SX3 B7 RETURNED FWA
  358. BX7 X2+X3
  359. SA7 A2
  360. *ENDIF FOR CDC INTERNAL USE ONLY
  361.  
  362. STAT3 IFEQ STAT,1
  363. SA1 ST$NOL INCREMENT TOTAL NUMBER OF OVERLAY LOADS
  364. SX6 1
  365. IX6 X6+X1
  366. SA6 ST$NOL
  367. SA1 ETIMEP PARAMETER BLOCK FOR CALLING OTIME
  368. RJ OTIME GET RTIME VALUE AFTER CALL
  369. SA1 STIME STARTING RTIME VALUE
  370. MX0 24D MASK FOR RTIME MILLESECOND VALUE
  371. BX1 -X0*X1 CLEAR SECONDS FIELD
  372. SA2 ETIME ENDING RTIME VALUE
  373. BX2 -X0*X2 CLEAR SECONDS FIELD
  374. IX6 X2-X1 ELAPSED TIME FOR SWAPIN
  375. SA1 ST$LOL LARGEST TIME SPENT IN OVLCALL
  376. IX5 X1-X6 DETERMINE IF LATEST TIME INTERVAL IS LARGER
  377. PL X5,OVLSEC5 IF PREVIOUS TIME INTERVAL WAS LARGER
  378. SA6 ST$LOL SAVE NEW LARGEST TIME INTERVAL
  379. OVLSEC5 SA3 ST$TOL PREVIOUS CUMULATIVE VALUE
  380. IX6 X3+X6 NEW CUMULATIVE VALUE
  381. SA6 ST$TOL
  382. STAT3 ENDIF
  383.  
  384. SX7 B0
  385. SA7 OVLNAME CLEAR OVLNAME IN OVERLAY COMMON BLK
  386. SA2 OVLADR1 X2 = RETURNED PARAMETER WORD
  387. MX4 6
  388. BX7 X2
  389. LX4 54
  390. BX4 X4*X2 SECONDARY LEVEL NUMBER OF THE LOAD
  391. SB5 B0
  392. ZR X4,SVLVL PRIMARY
  393. SB5 1 SECONDARY
  394. SVLVL SA7 LEVELS+B5 SAVE LOADED PARAMETER WORD
  395. JUMPX SB6 X2 ENTRY POINT ADDRESS IN B6
  396. * JUMP TO OVERLAY
  397. *
  398. JP B6 ENTRY POINT ADDR IN B6
  399. *
  400. * RETURN TO CALLING PROGRAM
  401. *
  402. RJMAIN BSS 0
  403. DEBUG3 IFEQ DEBUG,1
  404. *
  405. * CLEAR FLAG OF LAST OVERLAY LOADED
  406. *
  407. SX6 B0 USED TO CLEAR OVLFLAG
  408. SA1 OVLFLAG
  409. LX1 57 CHECK PRIMARY-OVL-LOADED-FIRST BIT
  410. NG X1,PRIFIRST IF PRI OVL LOADED FIRST
  411. LX1 2 CHECK IF PRI OVL ALSO LOADED
  412. PL X1,CLRFLAG IF ONLY SEC OVL LOADED
  413. SX6 2 CLEAR PRI-OVL-LOADED BIT
  414. EQ CLRFLAG
  415.  
  416. PRIFIRST LX1 1 CHECK IF SEC OVL ALSO LOADED
  417. PL X1,CLRFLAG IF ONLY PRI OVL LOADED
  418. SX6 4 CLEAR SEC-OVL-LOADED BIT
  419. CLRFLAG SA6 A1
  420. DEBUG3 ENDIF
  421. SA1 ADDRPTR X1 = ADDR FOR STORING NEXT RET ADDR
  422. SX6 X1-1 X6 = ADDR CONTAINING CURRENT RET ADDR
  423. SA6 A1
  424. SB2 X6
  425. JP B2 JUMP TO RETADDR TO RETURN
  426.  
  427. IFEQ DEBUG,1
  428. ABTNIP SX6 DOVLCAL1 REASON CODE FOR DUMPING FL
  429. SA6 DMPFLG
  430. RJ RDUMP DUMP NIP-S FIELD LENGTH
  431. SA1 MSGADDR
  432. RJ OMSG ISSUE DAYFILE MESSAGE
  433. ABORT ABORT SINCE OVERLAY WAS NOT LOADED
  434.  
  435. MSG DIS ,*OVERLAY NOT LOADED*
  436. MSGADDR VFD 60/MSG PTR TO DAYFILE MESSAGE
  437. BSSZ 1
  438. XOVLC DATA L*OVLCL*
  439. TEMP BSS 1
  440. ENDIF
  441.  
  442. STAT4 IFEQ STAT,1
  443. EXT OTIME
  444. STIMEP VFD 60D/STIME
  445. ETIMEP VFD 60D/ETIME
  446. STIME BSS 1 START TIME FOR COMPARING SWAPIN TIME DELAY
  447. ETIME BSS 1 END TIME FOR COMPARING SWAPIN TIME DELAY
  448. STAT4 ENDIF
  449.  
  450.  
  451. END
cdc/nos2.source/nam5871/ovlcall.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator