2)
1)
SM$ID),(ORDINAL),OFFSET,RSTATUS)
  • [00002] MBUFMAN - RETURNS MAP ENTRY OFFSET.
  • [00007] MBUFMAN - ENSURES THAT THE DESIRED MAP ENTRY IS IN THE BUFFER
  • [00037] PROC MCLOSE
  • [00038] PROC MFLUSH
  • [00039] PROC READ
  • [00040] PROC ZSETFET
  • [00128] PROC MCLOSE((SM$ID),RSTATUS)
    • [00129] MCLOSE - TERMINATE MAP REFERENCE BY CALLER.
    • [00133] MCLOSE - INDICATES TERMINATION OF MAP REFERENCES BY CALLER.
    • [00158] PROC MFLUSH
    • [00159] PROC RETERN
    • [00160] PROC ZSETFET
    • [00227] PROC MFLUSH
    • [00228] MFLUSH - FLUSH MAP TO FILE.
    • [00232] MFLUSH - ENSURES THAT THE RESULTS OF ANY PREVIOUS *MPUTENT*
    • [00249] PROC REWRITE
    • [00250] PROC REWRITR
    • [00324] PROC MGETENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS)
      • [00325] MGETENT - RETURN THE MAP ENTRY TO THE CALLER.
      • [00329] MGETENT - RETURNS THE REQUESTED MAP ENTRY TO THE CALLERS
      • [00364] PROC MBUFMAN
      • [00442] PROC MINIT ((LFN),(SM$ID),RSTATUS)
        • [00443] MINIT - INITIALIZE A *SMU* MAP.
        • [00447] MINIT - INITIALIZE A *SMMAP* TO INDICATE CARTRIDGES ARE
        • [00483] PROC PFD
        • [00484] PROC RETERN
        • [00485] PROC WRITER
        • [00486] PROC WRITEW
        • [00487] PROC ZSETFET
        • [00652] PROC MOPEN ((SM$ID),(LFN),(MODE),RSTATUS)
          • [00653] MOPEN - ESTABLISH CALLER ACCESS TO MAP FILE.
          • [00657] MOPEN - PREPARES THE MAP FILE FOR SUBSEQUENT REFERENCES BY THE
          • [00691] PROC MCLOSE
          • [00692] PROC MFLUSH
          • [00693] PROC PFD
          • [00694] PROC READ
          • [00695] PROC ZSETFET
          • [00815] PROC MPUTENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS)
            • [00816] MPUTENT - MAP ENTRY TO THE MAP FILE BUFFER.
            • [00820] MPUTENT - MOVES THE REQUESTED MAP ENTRY FROM THE CALLERS
            • [00858] PROC MBUFMAN
            • [00946] PROC MRCLMLK((SM$ID),RSTATUS)
              • [00947] MRCLMLK - RECLAIM MAP INTERLOCK.
              • [00951] MRCLMLK - TRIES TO RECLAIM THE MAP FILE FOR THE SPECIFIED *SM*.
              • [00981] PROC MESSAGE
              • [00982] PROC MOPEN
              • [00983] PROC PF
              • [01063] PROC MRELSLK ((SM$ID
              2)

              ACCMAP

              Table Of Contents

              • [00001] PROC MBUFMAN 1)
              • [01064] MRELSLK - RETURN A MAP FILE.
              • [01068] MRELSLK - RETURNS A *SMMAP* FILE FOR A *SMID* WHICH HAS BEEN
              • [01086] PROC MFLUSH
              • [01087] PROC RETERN
              • [01088] PROC RTIME
              • [01089] PROC ZSETFET
              </WRAP> === Source Code ===
              ACCMAP.txt
              1. PROC MBUFMAN ((SM$ID),(ORDINAL),OFFSET,RSTATUS);
              2. # TITLE MBUFMAN - RETURNS MAP ENTRY OFFSET. #
              3.  
              4. BEGIN # MBUFMAN #
              5.  
              6. #
              7. ** MBUFMAN - ENSURES THAT THE DESIRED MAP ENTRY IS IN THE BUFFER
              8. * AND RETURNS THE WORD OFFSET OF THE ENTRY WITHIN
              9. * THE BUFFER.
              10. *
              11. * MBUFMAN - IS CALLED BY MGETENT AND MPUTENT.
              12. *
              13. * PROC MBUFMAN (SM$ID,ORDINAL,OFFSET,RSTATUS)
              14. *
              15. * ENTRY SM$ID - *SM* NUMBER.
              16. * ORDINAL - *XY* COORDINATE ORDINAL.
              17. *
              18. * EXIT OFFSET - OFFSET OF ENTRY.
              19. * RSTATUS - ERROR STATUS.
              20. * (VALUES DEFINED IN *COMBCMS*)
              21. * = NO ERRORS.
              22. * = *CIO* ERROR.
              23. * = MAP ORDINAL OUT OF RANGE.
              24. #
              25.  
              26. ITEM SM$ID U; # *SM* NUMBER #
              27. ITEM ORDINAL U; # *XY* COORDINATE ORDINAL #
              28. ITEM OFFSET U; # ENTRY OFFSET #
              29. ITEM RSTATUS U; # STATUS RETURNED TO CALLER #
              30.  
              31. #
              32. **** PROC MBUFMAN - XREF LIST BEGIN.
              33. #
              34.  
              35. XREF
              36. BEGIN
              37. PROC MCLOSE; # CLOSE MAP #
              38. PROC MFLUSH; # FLUSH MAP TO FILE #
              39. PROC READ; # INTERFACE TO *READ* MACRO #
              40. PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* #
              41. END
              42.  
              43. #
              44. **** PROC MBUFMAN - EXREF LIST END.
              45. #
              46.  
              47. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
              48. *CALL COMBFAS
              49. *CALL COMBCMD
              50. *CALL COMBCMS
              51. *CALL COMBFET
              52. *CALL COMBMAP
              53. *CALL COMBMCT
              54. *CALL COMXMSC
              55. *CALL COMSPFM
              56.  
              57. ITEM BFWA U; # WORD ADDRESS OF FIRST ENTRY
              58.   IN BUFFER #
              59. ITEM DWA U; # WORD ADDRESS OF DESIRED ENTRY #
              60. ITEM PRUNUM U; # *PRU* NUMBER WHERE *XY* ENTRY
              61.   RESIDES #
              62.  
              63.  
              64.  
              65.  
              66.  
              67. RSTATUS = CMASTAT"NOERR";
              68.  
              69. #
              70. * *XY* COORDINATE HAS TO BE 1 - 352.
              71. #
              72.  
              73. IF ORDINAL LQ 0 OR ORDINAL GR MAXORD
              74. THEN
              75. BEGIN
              76. RSTATUS = CMASTAT"ORDERR";
              77. RETURN;
              78. END
              79.  
              80. #
              81. * COMPUTE
              82. * DWA - WORD ADDRESS IN MAP OF DESIRED MAP ENTRY.
              83. * BFWA - WORD ADDRESS OF FIRST ENTRY IN BUFFER.
              84. #
              85.  
              86. DWA = ORDINAL * MAPENTL;
              87. BFWA = (MB$PRUNUM[0] - 1) * PRULEN;
              88.  
              89. #
              90. * ENSURE DESIRED ENTRY IS IN THE BUFFER.
              91. #
              92.  
              93. IF MB$SMID[0] NQ SM$ID OR MB$PRUNUM[0] EQ 0 # #
              94. OR BFWA GR DWA OR DWA GR (BFWA + MAPBUFL - MAPENTL)
              95. THEN
              96. BEGIN # ENTRY NOT IN BUFFER #
              97. IF MB$BMF[0]
              98. THEN
              99. BEGIN
              100. MFLUSH;
              101. END
              102.  
              103. PRUNUM = (DWA/PRULEN) + 1;
              104. ZSETFET(MAPFADR,OMT$LFN[SM$ID],MAPBADR,MAPBUFL,RFETL);
              105. FET$R[0] = TRUE;
              106. FET$RR[0] = PRUNUM;
              107. FET$EP[0] = TRUE;
              108. READ(MAPFET,RCL);
              109. IF FET$AT[0] NQ 0
              110. THEN
              111. BEGIN
              112. MCLOSE(ORDINAL);
              113. RSTATUS = CMASTAT"CIOERR";
              114. RETURN;
              115. END
              116.  
              117. MB$PRUNUM[0] = PRUNUM;
              118. MB$SMID[0] = SM$ID;
              119. MB$LFN[0] = OMT$LFN[SM$ID];
              120. BFWA = (PRUNUM - 1) * PRULEN;
              121. END # ENTRY NOT IN BUFFER #
              122.  
              123. OFFSET = (DWA - BFWA);
              124. RETURN;
              125. END # MBUFMAN #
              126.  
              127. TERM
              128. PROC MCLOSE((SM$ID),RSTATUS);
              129. # TITLE MCLOSE - TERMINATE MAP REFERENCE BY CALLER. #
              130. BEGIN # MCLOSE #
              131.  
              132. #
              133. ** MCLOSE - INDICATES TERMINATION OF MAP REFERENCES BY CALLER.
              134. *
              135. * MCLOSE - IS CALLED BY DBCMAP,DBFLAG,DBRDSTM,MBUFMAN,MOPEN,
              136. * TERMCAT,USRPC,VLSUBFM.
              137. *
              138. * PROC MCLOSE (SM$ID,RSTATUS)
              139. *
              140. * ENTRY SM$ID - *SM* NUMBER FROM CALLER.
              141. *
              142. * EXIT RSTATUS - ERROR STATUS.
              143. * (VALUES DEFINED IN *COMBCMS*)
              144. * = NO ERRORS.
              145. * = MAP NOT OPEN.
              146. *
              147. #
              148.  
              149. ITEM SM$ID U; # *SM* NUMBER FROM CALLER #
              150. ITEM RSTATUS U; # ERROR STATUS RETURNED #
              151.  
              152. #
              153. **** PROC MCLOSE - XREF LIST BEGIN.
              154. #
              155.  
              156. XREF
              157. BEGIN
              158. PROC MFLUSH; # FLUSH MAP TO FILE #
              159. PROC RETERN; # INTERFACE TO *RETURN* MACRO #
              160. PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* #
              161. END
              162.  
              163. #
              164. **** PROC MCLOSE - EXREF LIST END.
              165. #
              166.  
              167. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              168. *CALL COMBFAS
              169. *CALL COMBCMD
              170. *CALL COMBCMS
              171. *CALL COMBFET
              172. *CALL COMBMCT
              173. *CALL COMXMSC
              174. *CALL COMSPFM
              175.  
              176.  
              177.  
              178.  
              179.  
              180. RSTATUS = CMASTAT"NOERR";
              181.  
              182. #
              183. * MAP HAS TO BE OPEN.
              184. #
              185.  
              186. IF NOT OMT$OPEN[SM$ID]
              187. THEN
              188. BEGIN
              189. RSTATUS = CMASTAT"NOTOPEN";
              190. RETURN;
              191. END
              192.  
              193. #
              194. * CLEAR *OMT* ENTRY IF INTERLOCKED.
              195. #
              196.  
              197. IF OMT$INTLK[SM$ID]
              198. THEN
              199. BEGIN
              200. OMT$OPEN[SM$ID] = FALSE;
              201. OMT$INTLK[SM$ID] = FALSE;
              202. RETURN;
              203. END
              204.  
              205.  
              206. #
              207. * FLUSH BUFFER IF *MODIFY* MODE.
              208. #
              209.  
              210. IF MB$SMID[0] EQ SM$ID AND OMT$ATTM[SM$ID] EQ "M"
              211. THEN
              212. BEGIN
              213. MFLUSH;
              214. END
              215.  
              216. #
              217. * SET UP *FET* AND RETURN THE FILE.
              218. #
              219.  
              220. ZSETFET(MAPFADR,OMT$LFN[SM$ID],MAPBADR,MAPBUFL,RFETL);
              221. RETERN(MAPFET,RCL);
              222. OMT$OPEN[SM$ID] = FALSE;
              223. RETURN;
              224. END # MCLOSE #
              225.  
              226. TERM
              227. PROC MFLUSH;
              228. # TITLE MFLUSH - FLUSH MAP TO FILE. #
              229. BEGIN # MFLUSH #
              230.  
              231. #
              232. ** MFLUSH - ENSURES THAT THE RESULTS OF ANY PREVIOUS *MPUTENT*
              233. * REQUESTS ARE WRITTEN TO THE MAP FILE.
              234. *
              235. *
              236. * MFLUSH - IS CALLED BY ADDCAR,ADDCUBE,MBUFMAN,MCLOSE,MRELSLK,
              237. * RVMCAR,RVMCUBE.
              238. *
              239. * PROC MFLUSH
              240. *
              241. #
              242.  
              243. #
              244. **** PROC MFLUSH - XREF LIST BEGIN.
              245. #
              246.  
              247. XREF
              248. BEGIN
              249. PROC REWRITE; # INTERFACE TO *REWRITE* MACRO #
              250. PROC REWRITR; # INTERFACE #
              251. END
              252.  
              253. #
              254. **** PROC MFLUSH - EXREF LIST END.
              255. #
              256.  
              257. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              258. *CALL COMBFAS
              259. *CALL COMBCMD
              260. *CALL COMBCMS
              261. *CALL COMBFET
              262. *CALL COMBMAP
              263. *CALL COMBMCT
              264. *CALL COMXMSC
              265. *CALL COMSPFM
              266.  
              267.  
              268.  
              269.  
              270.  
              271. #
              272. * IF BUFFER NOT MODIFIED, EXIT.
              273. #
              274.  
              275. IF NOT MB$BMF[0]
              276. THEN
              277. BEGIN
              278. IF OMT$ATTM[MB$SMID[0]] NQ "M"
              279. THEN
              280. BEGIN
              281. MB$CWRD[0] = 0;
              282. END
              283.  
              284. RETURN;
              285. END
              286.  
              287. #
              288. * REWRITE MAP BUFFER TO THE FILE.
              289. #
              290.  
              291. P<FETSET> = MAPFADR;
              292. FET$R[0] = TRUE;
              293. FET$RR[0] = MB$PRUNUM[0];
              294. FET$EP[0] = TRUE;
              295. FET$LFN[0] = MB$LFN[0];
              296. IF MB$PRUNUM[0] EQ 17
              297. THEN # PARTIAL PRU #
              298. BEGIN
              299. REWRITR(MAPFET,RCL);
              300. END
              301.  
              302. ELSE
              303. BEGIN
              304. IF MB$PRUNUM[0] EQ 16
              305. THEN # PARTIAL PRU STILL REMAINS #
              306. BEGIN
              307. REWRITE(MAPFET,RCL);
              308. FET$RR[0] = 17;
              309. REWRITR(MAPFET,RCL);
              310. END
              311.  
              312. ELSE
              313. BEGIN
              314. REWRITE(MAPFET,RCL);
              315. END
              316. END
              317.  
              318. P<FETSET> = TFETADR;
              319. MB$CWRD[0] = 0;
              320. RETURN;
              321. END # MFLUSH #
              322.  
              323. TERM
              324. PROC MGETENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS);
              325. # TITLE MGETENT - RETURN THE MAP ENTRY TO THE CALLER. #
              326. BEGIN # MGETENT #
              327.  
              328. #
              329. ** MGETENT - RETURNS THE REQUESTED MAP ENTRY TO THE CALLERS
              330. * MEMORY SPACE.
              331. *
              332. * MGETENT - IS CALLED BY ADDCAR,ADDCUBE,DBCMAP,DBFLAG,
              333. * DBVSN,MSFINIT,RMVCAR,RMVCUBE,SERCSU,USRPG,VLCMAP,
              334. * VLCSUSC.
              335. *
              336. *
              337. * PROC MGETENT (SM$ID,ORDINAL,MAPADR,RSTATUS)
              338. *
              339. * ENTRY SM$ID - *SM* NUMBER.
              340. * ORDINAL - *XY* COORDINATE ORDINAL.
              341. * MAPADR - ADDRESS OF ENTRY DESTINATION.
              342. *
              343. * EXIT (MAPADR) - MAP ENTRY.
              344. * RSTATUS - ERROR STATUS.
              345. * (VALUES DEFINED IN *COMBCMS*)
              346. * = NO ERRORS.
              347. * = MAP INTERLOCKED.
              348. * = MAP NOT OPEN.
              349. * = *CIO* ERROR.
              350. * = MAP ORDINAL OUT OF RANGE.
              351. #
              352.  
              353. ITEM SM$ID U; # *SM* NUMBER #
              354. ITEM ORDINAL U; # *XY* COORDINATE ORDINAL #
              355. ITEM MAPADR U; # ENTRY DESTINATION #
              356. ITEM RSTATUS U; # STATUS RETURNED TO CALLER #
              357.  
              358. #
              359. **** PROC MGETENT - XREF LIST BEGIN.
              360. #
              361.  
              362. XREF
              363. BEGIN
              364. PROC MBUFMAN; # GET ENTRY OFFSET #
              365. END
              366.  
              367. #
              368. **** PROC MGETENT - EXREF LIST END.
              369. #
              370.  
              371. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              372. *CALL COMBFAS
              373. *CALL COMBCMD
              374. *CALL COMBCMS
              375. *CALL COMBMAP
              376.  
              377. ITEM I I; # INDUCTION VARIABLE #
              378. ITEM OFFSET U; # RELATIVE LOCATION OF *XY* IN
              379.   BUFFER #
              380.  
              381. BASED
              382. ARRAY MENTRY [0:0] P(1);
              383. BEGIN
              384. ITEM ENT$WRD U(00,00,60); # ENTRY WORD #
              385. END
              386.  
              387.  
              388.  
              389.  
              390.  
              391. RSTATUS = CMASTAT"NOERR";
              392.  
              393. #
              394. * RETURN ERROR IF FILE INTERLOCKED.
              395. #
              396.  
              397. IF OMT$INTLK[SM$ID]
              398. THEN
              399. BEGIN
              400. RSTATUS = CMASTAT"INTLK";
              401. RETURN;
              402. END
              403.  
              404. #
              405. * MAP FILE HAS TO BE OPEN.
              406. #
              407.  
              408. IF NOT OMT$OPEN[SM$ID]
              409. THEN
              410. BEGIN
              411. RSTATUS = CMASTAT"NOTOPEN";
              412. RETURN;
              413. END
              414.  
              415. #
              416. * GET OFFSET OF ENTRY IN BUFFER.
              417. #
              418.  
              419. MBUFMAN(SM$ID,ORDINAL,OFFSET,RSTATUS);
              420. IF RSTATUS NQ 0
              421. THEN
              422. BEGIN
              423. RETURN;
              424. END
              425.  
              426. #
              427. * TRANSFER ENTRY TO CALLER.
              428. #
              429.  
              430. P<MENTRY> = MAPADR;
              431. P<MAPBUF> = MAPBADR;
              432. FASTFOR I = 1 STEP 1 UNTIL MAPENTL
              433. DO
              434. BEGIN
              435. ENT$WRD[I - 1] = MAPB$W[OFFSET + I];
              436. END
              437.  
              438. RETURN;
              439. END # MGETENT #
              440.  
              441. TERM
              442. PROC MINIT ((LFN),(SM$ID),RSTATUS);
              443. # TITLE MINIT - INITIALIZE A *SMU* MAP. #
              444. BEGIN # MINIT #
              445.  
              446. #
              447. ** MINIT - INITIALIZE A *SMMAP* TO INDICATE CARTRIDGES ARE
              448. * EITHER:
              449. * 1. NON EXISTENT (NO CUBES)
              450. * 2. RESERVED FOR CE USE OR
              451. * 3. UNASSIGNED
              452. * 4. RESERVED FOR SYSTEM USE
              453. *
              454. * THE PREAMBLE OF THE FILE WHICH CONTAINS THE MAP AND
              455. * OTHER FIELDS IN THE MAP ARE APPROPRIATELY FILLED IN
              456. * WITH ZEROES OR SPACES.
              457. *
              458. *
              459. * MINIT - IS CALLED BY SSDEF FOR EACH SM THAT SSDF CREATES.
              460. *
              461. * PROC MINIT(LFN,RSTATUS)
              462. *
              463. * ENTRY LFN - MAP FILE NAME.
              464. *
              465. * EXIT RSTATUS - ERROR STATUS.
              466. * (VALUES DEFINED IN *COMBCMS*)
              467. * = NO ERRORS.
              468. * = MAP ALREADY EXISTS.
              469. * = *CIO* ERROR.
              470. * = MAP DEFINE ERROR.
              471. #
              472.  
              473. ITEM LFN C(6); # NAME OF MAP FILE #
              474. ITEM SM$ID U; # *SM* NUMBER #
              475. ITEM RSTATUS I; # ERROR STATUS #
              476.  
              477. #
              478. **** PROC MINIT - XREF LIST BEGIN.
              479. #
              480.  
              481. XREF
              482. BEGIN
              483. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
              484. PROC RETERN; # INTERFACE TO *RETURN* MACRO #
              485. PROC WRITER; # INTERFACE TO *WRITER* MACRO #
              486. PROC WRITEW; # INTERFACE TO *WRITEW* MACRO #
              487. PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* #
              488. END
              489.  
              490. #
              491. **** PROC MINIT - EXREF LIST END.
              492. #
              493.  
              494. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              495. *CALL COMBFAS
              496. *CALL COMBCMD
              497. *CALL COMBCMS
              498. *CALL COMBFET
              499. *CALL COMBMAP
              500. *CALL COMBMCT
              501. *CALL COMBPFS
              502. *CALL COMXMSC
              503. *CALL COMSPFM
              504.  
              505.  
              506. ITEM ZI U; # *Z* COUNTER FOR ORDINAL
              507.   CALCULATION #
              508. ITEM YI U; # *Y* COUNTER FOR ORDINAL
              509.   CALCULATION #
              510. ITEM MAPORD U; # ORDINAL OF CARTRIDGE IN MAP #
              511. ITEM WRITESTAT U; # STATUS FROM *WRITEW* MACRO #
              512.  
              513. #
              514. * DEFINITION OF A MAP ENTRY WHICH IS USED
              515. * TO INITIALIZE A MAP FILE.
              516. #
              517.  
              518. ARRAY SMUENTRY [0:0] P(MAPENTL); # CHANGE LINES 2032,2035,2099 #
              519. BEGIN
              520. ITEM FILLWRD1 U(00,00,60) = [O"0000 0055 5555 5555 5555"];
              521. ITEM FILLWRD2 U(01,00,60);
              522. ITEM FILLWRD3 U(02,00,60) = [O"0000 5555 5555 5555 5555"];
              523. END
              524.  
              525.  
              526.  
              527.  
              528. RSTATUS = CMASTAT"NOERR";
              529. #
              530. * DEFINE A PERMANENT FILE FOR THE MAP.
              531. #
              532.  
              533. PFD("DEFINE",LFN,0,"BR","Y","RC",PFSTAT,"UP",0,0);
              534. IF PFSTAT NQ 0
              535. THEN
              536. BEGIN
              537. IF PFSTAT EQ FAP
              538. THEN
              539. BEGIN
              540. RSTATUS = CMASTAT"INTLZD";
              541. END
              542.  
              543. ELSE
              544. BEGIN
              545. RSTATUS = CMASTAT"DEFERR";
              546. END
              547.  
              548. RETURN;
              549. END
              550.  
              551. #
              552. * INITIALIZE A *SMUMAP* FET.
              553. #
              554.  
              555. ZSETFET (MAPFADR,LFN,MAPBADR,MAPBUFL,RFETL);
              556. FET$EP[0] =TRUE;
              557.  
              558. #
              559. * INITIALIZE THE PREAMBLE FOR THE MAP FILE.
              560. #
              561.  
              562. P<SMUMAP> = LOC(SMUENTRY); # CHANGE CSUMAP TO SMUMAP #
              563. CM$CODE[0] = CUBSTAT"NOCUBE";
              564. CM$SMID = SM$ID;
              565. WRITEW(MAPFET,SMUENTRY,MAPENTL,WRITESTAT);
              566. IF FET$AT[0] NQ 0
              567. THEN
              568. BEGIN
              569. RSTATUS = CMASTAT"CIOERR";
              570. RETERN(MAPFET);
              571. RETURN;
              572. END
              573.  
              574.  
              575. #
              576. * PREPARE A BUFFER FOR THE FILE.
              577. * DATA IS MOVED INTO THE CIRCULAR BUFFER IN ORDINAL FASHION BY
              578. * EXECUTING A DRECEMENTING * DO* LOOP FOR * Z* INSIDE A
              579. * *DO* LOOP FOR *Y*. THIS IS EQUIVALENT TO THE ORDINAL
              580. * CALCULATION DESCRIBED BY NOCUBES-Z-(Y-MAX$Z).
              581. #
              582.  
              583.  
              584. # CHANGE LINES 2054 THROUGH 2110 #
              585. FASTFOR YI = MAX$Y STEP -1 UNTIL 0
              586. DO
              587. BEGIN # YI DO #
              588. FASTFOR ZI = MAX$Z STEP -1 UNTIL 0
              589. DO
              590. BEGIN # ZI DO #
              591. CM$CODE[0] = CUBSTAT"UNASGN";
              592.  
              593. #
              594. * THERE ARE NO CUBICLES FOR CARTRIDGES AT *Z* = 6 BECAUSE
              595. * THE DRDS RESIDE IN THIS AREA. THERE ARE NO CUBICLES
              596. * AT THE FOLLOWING COORDINATES: *Z* = 0 *Y* = 15,
              597. * *Z* = 1 *Y* = 15, *Z* = 0 *Y* = 14, *Z* = 1 *Y* = 14,
              598. * *Z* = 0 *Y* = 13, *Z* = 1 *Y* = 13, *Z* = 0 *Y* = 12,
              599. * *Z* = 1 *Y* = 12, *Z* = 0 *Y* = 11, *Z* = 1 *Y* = 11.
              600. * THERE ARE NO CUBLICLES IN THE PREVIOUSLY LISTED COORDINATES
              601. * BECAUSE THE ENTRY TRAY IS PHYSICALLY LOCATED AT THESE LOCATIONS.
              602. #
              603.  
              604. IF ZI EQ 6 OR (( YI LQ 15 AND YI GQ 11)
              605. AND (ZI EQ 0 OR ZI EQ 1))
              606. THEN
              607. BEGIN
              608. CM$CODE[0] = CUBSTAT"NOCUBE";
              609. END
              610.  
              611. #
              612. * RESERVE *CE* CUBICLES.
              613. #
              614.  
              615. IF ((YI EQ 0) AND ( ZI EQ 0 OR ZI EQ 15))
              616. OR (( ZI EQ 15) AND ( YI EQ 11 OR YI EQ 21))
              617. THEN
              618. BEGIN
              619. CM$CODE[0] = CUBSTAT"CEUSE";
              620. END
              621.  
              622.  
              623. WRITEW(MAPFET,SMUENTRY,MAPENTL,WRITESTAT);
              624. IF FET$AT[0] NQ 0
              625. THEN
              626. BEGIN
              627. RSTATUS = CMASTAT"CIOERR";
              628. RETERN(MAPFET);
              629. RETURN;
              630. END
              631.  
              632. END # ZI DO #
              633.  
              634. END # YI DO #
              635.  
              636. #
              637. * FLUSH THE CIRCULAR BUFFER TO DISK.
              638. #
              639.  
              640. WRITER(MAPFET,RCL);
              641. IF FET$AT[0] NQ 0
              642. THEN
              643. BEGIN
              644. RSTATUS = CMASTAT"CIOERR";
              645. END
              646.  
              647. RETERN(MAPFET);
              648. RETURN;
              649. END # MINIT #
              650.  
              651. TERM
              652. PROC MOPEN ((SM$ID),(LFN),(MODE),RSTATUS);
              653. # TITLE MOPEN - ESTABLISH CALLER ACCESS TO MAP FILE. #
              654. BEGIN # MOPEN #
              655.  
              656. #
              657. ** MOPEN - PREPARES THE MAP FILE FOR SUBSEQUENT REFERENCES BY THE
              658. * CALLER.
              659. *
              660. * MOPEN - IS CALLED BY USRPC,VLSUBSM.
              661. *
              662. * PROC MOPEN (SM$ID,LFN,MODE,RSTATUS)
              663. *
              664. * ENTRY SM$ID - *SM* NUMBER FOR THE MAP.
              665. * LFN - NAME OF MAP FILE.
              666. * MODE - FILE ATTACH MODE IN DISPLAY CODE.
              667. * = *M*, MODIFY MODE.
              668. * = *RM*, READ/ALLOW MODIFY MODE.
              669. *
              670. * EXIT RSTATUS - ERROR STATUS.
              671. * (VALUES DEFINED IN *COMBCMS*)
              672. * = NO ERRORS.
              673. * = MAP INTERLOCKED.
              674. * = MAP ALREADY OPEN.
              675. * = *CIO* ERROR.
              676. * = MAP ATTACH ERROR.
              677. #
              678.  
              679. ITEM SM$ID U; # *SM* NUMBER FOR MAP #
              680. ITEM LFN C(6); # NAME OF MAP FILE #
              681. ITEM MODE C(2); # FILE ATTACH MODE #
              682. ITEM RSTATUS U; # ERROR STATUS RETURNED #
              683.  
              684. #
              685. **** PROC MOPEN - XREF LIST BEGIN.
              686. #
              687.  
              688.  
              689. XREF
              690. BEGIN
              691. PROC MCLOSE; # CLOSE MAP #
              692. PROC MFLUSH; # FLUSH MAP TO FILE #
              693. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
              694. PROC READ; # INTERFACE TO *READ* MACRO #
              695. PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* #
              696. END
              697.  
              698. #
              699. **** PROC MOPEN - EXREF LIST END.
              700. #
              701.  
              702.  
              703. DEF LISTCON #0#; # NO LISTING OF COMMON DECKS #
              704. *CALL COMBFAS
              705. *CALL COMBCMD
              706. *CALL COMBCMS
              707. *CALL COMBFET
              708. *CALL COMBMAP
              709. *CALL COMBMCT
              710. *CALL COMBPFS
              711. *CALL COMXCTF
              712. *CALL COMXMSC
              713. *CALL COMSPFM
              714.  
              715.  
              716. ITEM ZERO U = 0; # WORD OF ZERO #
              717.  
              718.  
              719.  
              720.  
              721.  
              722. RSTATUS = CMASTAT"NOERR";
              723. P<OMT> = OMTADR;
              724.  
              725. #
              726. * RETURN ERROR IF FILE OPEN.
              727. #
              728.  
              729. IF OMT$OPEN [SM$ID]
              730. THEN
              731. BEGIN
              732. RSTATUS = CMASTAT"FOPEN";
              733. RETURN;
              734. END
              735.  
              736. PFD("ATTACH",LFN,0,"M",MODE,"RC",PFSTAT,"NA",0,"UP",0,0);
              737.  
              738. #
              739. * RETURN ATTACH ERROR IF NOT BUSY.
              740. #
              741.  
              742. IF PFSTAT NQ 0 AND PFSTAT NQ FBS
              743. THEN
              744. BEGIN
              745. RSTATUS = CMASTAT"ATTERR";
              746. RETURN;
              747. END
              748.  
              749. #
              750. * CREATE AN OPEN MAP TABLE ENTRY FOR AN EXISTING FILE.
              751. #
              752.  
              753. OMT$ATTM[SM$ID] = MODE;
              754. OMT$LFN[SM$ID] = LFN;
              755. OMT$ZER[SM$ID] = 0;
              756.  
              757. #
              758. * INTERLOCK THE FILE IF BUSY.
              759. #
              760.  
              761. IF PFSTAT EQ FBS
              762. THEN
              763. BEGIN
              764. OMT$INTLK[SM$ID] = TRUE;
              765. MAPINTLK = TRUE;
              766. RSTATUS = CMASTAT"INTLK";
              767. RETURN;
              768. END
              769.  
              770. #
              771. * SET FILE OPEN AND AVAILABLE.
              772. #
              773.  
              774. OMT$INTLK[SM$ID] = FALSE;
              775. OMT$OPEN[SM$ID] = TRUE;
              776. MFLUSH;
              777. ZSETFET (MAPFADR,LFN,MAPBADR,MAPBUFL,RFETL);
              778. P<MAPFET> = MAPFADR;
              779. FET$EP[0] = TRUE;
              780. FET$R[0] = TRUE;
              781. FET$RR[0] = 1;
              782. READ(MAPFET,RCL);
              783. IF FET$AT[0] NQ 0
              784. THEN
              785. BEGIN
              786. MCLOSE(SM$ID);
              787. RSTATUS = CMASTAT"CIOERR";
              788. RETURN;
              789. END
              790.  
              791. #
              792. * UPDATE MAP BUFFER CONTROL WORD TO REFLECT CURRENT CONTENTS.
              793. #
              794.  
              795. P<SMUMAP> = MAPBADR;
              796. MB$PRUNUM[0] = 1;
              797. MB$SMID[0] = CM$SMID[0];
              798. MB$LFN[0] = OMT$LFN[SM$ID];
              799.  
              800. #
              801. * VERIFY THAT THE RIGHT FILE HAS BEEN ATTACHED.
              802. #
              803.  
              804. IF CM$SMID[0] NQ SM$ID
              805. THEN
              806. BEGIN
              807. MCLOSE(SM$ID,RSTATUS);
              808. RSTATUS = CMASTAT"ATTERR";
              809. END
              810.  
              811. RETURN;
              812. END # MOPEN #
              813.  
              814. TERM
              815. PROC MPUTENT ((SM$ID),(ORDINAL),(MAPADR),RSTATUS);
              816. # TITLE MPUTENT - MAP ENTRY TO THE MAP FILE BUFFER. #
              817. BEGIN # MPUTENT #
              818.  
              819. #
              820. ** MPUTENT - MOVES THE REQUESTED MAP ENTRY FROM THE CALLERS
              821. * MEMORY SPACE TO THE MAP *I/O* BUFFER.
              822. *
              823. * THE BUFFER IS NOT WRITTEN TO THE FILE AT THIS TIME
              824. * BUT THE BUFFER MODIFIED FLAG IS SET.
              825. * THE CALLER IS RESPONSIBLE FOR CALLING *MFLUSH* AT THE
              826. * TIME THE BUFFER SHOULD BE WRITTEN TO THE FILE.
              827. *
              828. * MPUTENT - IS CALLED BY ADDCAR,ADDCUBE,RMVCAR,RMVCUBE,
              829. * UPDMAP.
              830. *
              831. * PROC MPUTENT (SM$ID,ORDINAL,MAPADR,RSTATUS)
              832. *
              833. * ENTRY SM$ID - *SM* NUMBER OF MAP FILE.
              834. * ORDINAL - *XY* COORDINATE ORDINAL FOR THE ENTRY.
              835. * MAPADR - ADDRESS OF MAP ENTRY WITHIN CALLER AREA.
              836. *
              837. * EXIT RSTATUS - ERROR STATUS.
              838. * (VALUES DEFINED IN *COMBCMS*)
              839. * = NO ERRORS.
              840. * = MAP INTERLOCKED.
              841. * = MAP NOT OPEN.
              842. * = MAP NOT OPEN IN MODIFY MODE.
              843. * = *CIO* ERROR.
              844. * = MAP ORDINAL OUT OF RANGE.
              845. #
              846.  
              847. ITEM SM$ID U; # *SM* NUMBER #
              848. ITEM ORDINAL U; # *XY* COORDINATE ORDINAL #
              849. ITEM MAPADR U; # SOURCE OF CATALOG ENTRY #
              850. ITEM RSTATUS U; # STATUS RETURNED TO THE CALLER #
              851.  
              852. #
              853. **** PROC MPUTENT - XREF LIST BEGIN.
              854. #
              855.  
              856. XREF
              857. BEGIN
              858. PROC MBUFMAN; # GET ENTRY INTO BUFFER #
              859. END
              860.  
              861. #
              862. **** PROC MPUTENT - EXREF LIST END.
              863. #
              864.  
              865. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              866. *CALL COMBFAS
              867. *CALL COMBCMD
              868. *CALL COMBCMS
              869. *CALL COMBMAP
              870. *CALL COMSPFM
              871.  
              872. ITEM I I; # INDUCTION VARIABLE #
              873. ITEM OFFSET U; # RELATIVE LOCATION OF *XY* IN
              874.   BUFFER #
              875.  
              876. BASED
              877. ARRAY MENTRY [0:0] P(1);
              878. BEGIN
              879. ITEM ENT$WRD U(00,00,60); # ENTRY WORD #
              880. END
              881.  
              882.  
              883.  
              884.  
              885.  
              886. RSTATUS = CMASTAT"NOERR";
              887.  
              888. #
              889. * RETURN ERROR IF FILE INTERLOCKED.
              890. #
              891.  
              892. IF OMT$INTLK[SM$ID]
              893. THEN
              894. BEGIN
              895. RSTATUS = CMASTAT"INTLK";
              896. RETURN;
              897. END
              898.  
              899. #
              900. *
              901. * MAP FILE HAS TO BE OPENED IN *MODIFY* MODE.
              902. #
              903.  
              904. IF NOT OMT$OPEN[SM$ID]
              905. THEN
              906. BEGIN
              907. RSTATUS = CMASTAT"NOTOPEN";
              908. RETURN;
              909. END
              910.  
              911. IF OMT$ATTM[SM$ID] EQ "RM"
              912. THEN
              913. BEGIN
              914. RSTATUS = CMASTAT"MODERR";
              915. RETURN;
              916. END
              917.  
              918. #
              919. * GET OFFSET OF ENTRY IN BUFFER.
              920. #
              921.  
              922. MBUFMAN(SM$ID,ORDINAL,OFFSET,RSTATUS);
              923. IF RSTATUS NQ 0
              924. THEN
              925. BEGIN
              926. RETURN;
              927. END
              928.  
              929. #
              930. * TRANSFER ENTRY TO BUFFER.
              931. #
              932.  
              933. P<MENTRY> = MAPADR;
              934. P<MAPBUF> = MAPBADR;
              935. FASTFOR I = 1 STEP 1 UNTIL MAPENTL
              936. DO
              937. BEGIN
              938. MAPB$W[OFFSET + I] = ENT$WRD[I - 1];
              939. END
              940.  
              941. MB$BMF[0] = TRUE;
              942. RETURN;
              943. END # MPUTENT #
              944.  
              945. TERM
              946. PROC MRCLMLK((SM$ID),RSTATUS);
              947. # TITLE MRCLMLK - RECLAIM MAP INTERLOCK. #
              948. BEGIN # MRCLMLK #
              949.  
              950. #
              951. ** MRCLMLK - TRIES TO RECLAIM THE MAP FILE FOR THE SPECIFIED *SM*.
              952. * IT IS ASSUMED THAT THE CALLER IS RUNNING UNDER THE
              953. * DEFAULT FAMILY AND USER INDEX OF 377760B.
              954. *
              955. * MRCLMLK - IS CALLED BY RCLMLK AND MAPRCLM.
              956. *
              957. * PROC MRCLMLK(SM$ID,RSTATUS)
              958. *
              959. * ENTRY SM$ID - *SM* NUMBER OF THE MAP.
              960. *
              961. * EXIT RSTATUS - ERROR STATUS.
              962. * (VALUES DEFINED IN *COMBCMS*)
              963. * = NO ERRORS.
              964. * = MAP INTERLOCKED.
              965. * = MAP ATTACH ERROR.
              966. *
              967. *
              968. * MESSAGES * UNABLE TO REATTACH SMUMAP.
              969. * CSMAPX CLOSED.*
              970. #
              971.  
              972. ITEM SM$ID U; # *SM* NUMBER #
              973. ITEM RSTATUS U; # ERROR STATUS RETURNED #
              974.  
              975. #
              976. **** PROC MRCLMLK - XREF LIST BEGIN.
              977. #
              978.  
              979. XREF
              980. BEGIN
              981. PROC MESSAGE; # ISSUE MESSAGE #
              982. PROC MOPEN; # OPEN MAP #
              983. PROC PF; # *PFM* REQUEST INTERFACE #
              984. END
              985.  
              986. #
              987. **** PROC MRCLMLK - EXREF LIST END.
              988. #
              989.  
              990. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
              991. *CALL COMBFAS
              992. *CALL COMBCMD
              993. *CALL COMBCMS
              994. *CALL COMBMCT
              995. *CALL COMXMSC
              996. *CALL COMSPFM
              997.  
              998. ITEM ATCH$STAT U; # STATUS FROM *ATTACH* REQUEST #
              999.  
              1000. RSTATUS = CMASTAT"NOERR";
              1001. P<OMT> = OMTADR;
              1002.  
              1003. #
              1004. * EXIT IF MAP NOT INTERLOCKED.
              1005. #
              1006.  
              1007. IF NOT OMT$INTLK[SM$ID]
              1008. THEN
              1009. BEGIN
              1010. RETURN;
              1011. END
              1012.  
              1013. #
              1014. * IF THE FILE IS OPEN, ATTACH IT.
              1015. * IF THE FILE IS NOT OPEN, OPEN IT.
              1016. #
              1017.  
              1018. IF NOT OMT$OPEN[SM$ID]
              1019. THEN
              1020. BEGIN
              1021. MOPEN(SM$ID,OMT$LFN[SM$ID],OMT$ATTM[SM$ID],RSTATUS);
              1022. RETURN;
              1023. END
              1024.  
              1025. PF("ATTACH",OMT$LFN[SM$ID],0,"M",OMT$ATTM[SM$ID],
              1026. "RC",ATCH$STAT,"NA",0,"UP",0,0);
              1027. IF ATCH$STAT NQ 0
              1028. THEN
              1029. BEGIN # INTERLOCK NOT RECLAIMED #
              1030. IF ATCH$STAT EQ FBS OR ATCH$STAT EQ PFA ##
              1031. OR ATCH$STAT EQ INA OR ATCH$STAT EQ FTF ##
              1032. OR ATCH$STAT EQ PEA
              1033. THEN # MAP BUSY OR TEMPORARY ERROR #
              1034. BEGIN
              1035. RSTATUS = CMASTAT"INTLK";
              1036. END
              1037.  
              1038. ELSE
              1039. BEGIN
              1040. RSTATUS = CMASTAT"ATTERR";
              1041. OMT$OPEN[SM$ID] = FALSE;
              1042. OMT$INTLK[SM$ID] = FALSE;
              1043. CMSGLINE[0] = MMSG1; # ISSUE ERROR MESSAGE #
              1044. MESSAGE(CMSGAREA,UDFL1);
              1045. CMSGLINE[0] = MMSGCLOSE;
              1046. CMSGMAPID[0] = SM$ID;
              1047. MESSAGE(CMSGAREA,UDFL1);
              1048. END
              1049.  
              1050. END # INTERLOCK NOT RECLAIMED #
              1051.  
              1052. ELSE # INTERLOCK RECLAIMED #
              1053. BEGIN
              1054. OMT$INTLK[SM$ID] = FALSE;
              1055. END
              1056.  
              1057.  
              1058. RETURN;
              1059.  
              1060. END # MRCLMLK #
              1061.  
              1062. TERM
              1063. PROC MRELSLK ((SM$ID));
              1064. # TITLE MRELSLK - RETURN A MAP FILE. #
              1065. BEGIN # MRELSLK #
              1066.  
              1067. #
              1068. ** MRELSLK - RETURNS A *SMMAP* FILE FOR A *SMID* WHICH HAS BEEN
              1069. * PREVIOUSLY OPENED IN *MODIFY* MODE.
              1070. *
              1071. * MRELSLK - IS CALLED BY MAPRELS.
              1072. *
              1073. * PROC MRELSLK (SM$ID)
              1074. *
              1075. * ENTRY SM$ID - *SM* NUMBER OF MAP FILE.
              1076. #
              1077.  
              1078. ITEM SM$ID U; # *SM* NUMBER FROM CALLER #
              1079.  
              1080. #
              1081. **** PROC MRELSLK - XREF LIST BEGIN.
              1082. #
              1083.  
              1084. XREF
              1085. BEGIN
              1086. PROC MFLUSH; # FLUSH MAP TO FILE #
              1087. PROC RETERN; # INTERFACE TO *RETURN* MACRO #
              1088. PROC RTIME; # GET CURRENT TIME #
              1089. PROC ZSETFET; # INITIALIZES A *FET* FOR *I/O* #
              1090. END
              1091.  
              1092. #
              1093. **** PROC MRELSLK - EXREF LIST END.
              1094. #
              1095.  
              1096. DEF LISTCON #0#; # CONTROLS COMDECK LISTING #
              1097. *CALL COMBFAS
              1098. *CALL COMBCMD
              1099. *CALL COMBCMS
              1100. *CALL COMBFET
              1101. *CALL COMBMCT
              1102. *CALL COMXCTF
              1103. *CALL COMXIPR
              1104. *CALL COMXMSC
              1105. *CALL COMSPFM
              1106.  
              1107.  
              1108.  
              1109.  
              1110.  
              1111. #
              1112. * MAP FILE HAS TO BE OPEN AND IN *MODIFY* MODE.
              1113. #
              1114.  
              1115. IF OMT$OPEN[SM$ID] # #
              1116. AND OMT$ATTM[SM$ID] EQ "M" # #
              1117. AND NOT OMT$INTLK[SM$ID]
              1118. THEN
              1119. BEGIN
              1120. MFLUSH;
              1121. P<FETSET> = MAPFADR;
              1122. FET$LFN[0] = OMT$LFN[SM$ID];
              1123. RETERN(MAPFET,RCL);
              1124. OMT$INTLK[SM$ID] = TRUE;
              1125. MAPINTLK = TRUE;
              1126. RTIME(RTIMESTAT[0]);
              1127. MAP$EXPIR = RTIMSECS[0] + MAP$INTV;
              1128. END
              1129.  
              1130. RETURN;
              1131. END # MRELSLK #
              1132.  
              1133. TERM