User Tools

Site Tools


cdc:nos2.source:nam5871:mrels

Table of Contents

MRELS

Table Of Contents

Source Code

MRELS.txt
  1. *DECK MRELS
  2. IDENT MRELS
  3. ENTRY MRELS
  4. EXT ABORT
  5. EXT BFSCAN
  6. EXT XTRACE
  7. EXT OMSG
  8. EXT RDUMP
  9. EXT XDROP
  10. LIST F
  11. *IF DEF,IMS
  12. *#
  13. *1DC MRELS 000100
  14. * 1. PROC NAME AUTHOR DATE 000110
  15. * MRELS P. C. TAM 77/09/27
  16. * 000130
  17. * 2. FUNCTIONAL DESCRIPTION. 000140
  18. * THIS ROUTINE IS RESPONSIBLE FOR RELEASING ONE BUFFER 000150
  19. * OF THE SPECIFIED FWA TO THE FREE CHAIN. 000160
  20. * 000170
  21. * 3. METHOD USED. 000180
  22. * CALLING ROUTINES PASS THE FWA OF BUFFER TO BE RELEASED. 000190
  23. * INCREMENT TOTAL NUMBER OF WORDS OF FREE CHAIN. 000200
  24. * SCAN THROUGH FREE CHAIN FOR PROPER POSITION TO CHAIN THE 000210
  25. * BUFFER BEING RELEASED. 000220
  26. * WHEN PROPER POSITION FOUND. CHECK WHETHER FORM CONTIGUOUS 000230
  27. * BUFFER WITH PRECEEDING OR FOLLOWING FREE BUFFERS OR NOT. 000240
  28. * DO THE LINKING. 000250
  29. * 000260
  30. * 4. ENTRY PARAMETERS. 000270
  31. * BUFWA FWA OF BUFFER TO RELEASE 000280
  32. * 000290
  33. * 5. EXIT PARAMETERS. NONE 000300
  34. * 000310
  35. * 6. COMDECKS CALLED. 000320
  36. * CYBERDEFS FREETAB INPARU MACDEF
  37. * STATTAB2
  38. * 000360
  39. * 7. ROUTINES CALLED. 000370
  40. * OMSG DAYFILE MESSAGE
  41. * RDUMP DUMP NIP ADDRESS SPACE
  42. * XDROP SET PIP DROP FLAG
  43. * XTRACE RECORD CALL 000390
  44. * 000400
  45. * 8. DAYFILE MESSAGES.
  46. * *MRELS BUFFER MANAGEMENT ERROR*
  47. * 000420
  48. *#
  49. *ENDIF
  50. *CALL MACDEF
  51. *CALL CYBERDEFS
  52. *CALL INPARU
  53. *CALL FREETAB
  54. *CALL STATTAB2
  55.  
  56.  
  57. MRELS SUBR = ENTRY/EXIT
  58.  
  59. IFEQ DEBUG,1,6
  60. SX6 A1
  61. SA6 TEMP
  62. SX1 XMRELS
  63. RJ XTRACE
  64. SA1 TEMP
  65. SA1 X1
  66.  
  67.  
  68. SA2 X1 (X2)=(BUFWA)
  69.  
  70. MX0 -FRBBS$ (X1)=FRBBS[BUFWA] RIGHT JUSTIFIED
  71. LOAD A5,X2,FRBBS# (X5)=FRBBS[BUFWA] WORD
  72. LX0 FRBBS?-FRBBS$+1
  73. BX1 -X0*X5
  74. LX1 -FRBBS?+FRBBS$-1
  75.  
  76.  
  77. D2 IFEQ DEBUG,1
  78. NZ X1,MRLD1
  79. SA1 MSGDR
  80. RJ ABORT *---ABORT---*
  81.  
  82. MRLD1 BSS 0
  83. D2 ENDIF
  84.  
  85. IFEQ STAT,1,4
  86. MX0 -1 INCREMENT ST$REL
  87. SA5 ST$REL
  88. IX6 X5-X0
  89. SA6 ST$REL
  90.  
  91. * INCREASE FREE CHAIN SIZE
  92.  
  93. SA5 FRETAB+FRESFB#
  94. IX6 X5+X1
  95. SA6 A5
  96. ***
  97. *
  98. * STEP 2 SCAN THRU FREE CHAIN FOR PROPER POSITION TO LINK RELEASED
  99. * BUFFER
  100. * WHEN EXIT FROM THIS STEP:
  101. * (B4) = PREBUF VALUE (PRECEDING BUFFER BASE ADDRESS)
  102. * (B5) = FOBUF VALUE (NEXT BUFFER BASE ADDRESS)
  103. * (B2) = BUFWA VALUE (BUFFER BEING RELEASED BASE ADDRESS)
  104. * (B3) = FRENOFB VALUE(NO. OF FREE BUFFER)
  105.  
  106. SA5 FRETAB+FREFBFP# READ FREFBFP WORD FROM CM
  107. SB5 X5 (B5)=FREFBFB VALUE (FOBUF)
  108. SB4 FRETAB (B4)=LOC(FRETAB) (PREBUF)
  109. SA5 FRETAB+FRENOFB# READ FRENOFB WORD FROM CM
  110. SB3 X5 (B3)=FRENOFB VALUE
  111. SB2 X2 (B2)=BUFWA (BUFWA)
  112. SB1 1 INITIALIZE LOOP COUNTER
  113.  
  114. MRLS1 GT B5,B2,FOUND IF FOBUF GR BUFWA, GO TO FOUND
  115. SB4 B5 PREBUF SET TO FOBUF
  116. LOAD A5,B5,FRBFBFP# (X5)=FRBFBFP[FOBUF] WORD
  117. SB5 X5 GET ONLY FRBFBFP FIELD
  118. SB1 B1+1 INCR. LOOP COUNTER
  119. LE B1,B3,MRLS1
  120.  
  121. ***
  122. *
  123. * STEP 3 FOUND PROPER POSITION FOR RELEASE BUFFER
  124. * CHECK WHETHER FORM CONTIGUOUS BLOCK WITH PRECEEDING OR
  125. * FOLLOWING BUFFERS
  126. * WHEN EXIT FROM THIS STEP:
  127. * (B7) = PREBUF+FRBBS[PREBUF] (LWA+1 OF PRECEDING BUFFER) TEMP1
  128. * (B6) = BUFWA+FRBBS[BUFWA] (LWA+1 OF RELEASE BUFFER ) TEMP2
  129. * B4, B5, B2, B3 ARE PERSERVED FROM PREVIOUS STEP
  130.  
  131. FOUND BSS 0
  132.  
  133. DZ IFEQ STAT,1
  134. SX6 B1 (X6)=NO OF BUFFERS EXAMINED
  135. SA5 ST$RNB UPDATE NO OF FREE BUFFERS TRANSVERSES
  136. IX6 X6+X5
  137. SA6 A5
  138. DZ ENDIF
  139.  
  140. LOAD A5,B4,FRBBS# (X5)=FRBBS[PREBUF] WORD
  141. MX0 -FRBBS$ MASK FOR FRBBS$ FIELD
  142. LX0 FRBBS?-FRBBS$+1 SHIFT TO APPR POS. IN WORD
  143. BX6 -X0*X5 GET FRBBS FIELD ONLY
  144. LX6 -FRBBS?+FRBBS$-1 FRBBS FD RIGHT JUSTIFY
  145. SB7 B4+X6 (B7)=PREBUF+FRBBS[PREBUF] LWA+1 OF PRE BLK
  146. SB6 B2+X1 (B6)=BUFWA+FRBBS[BUFWA] LWA+1 OF RELEASE BF
  147.  
  148. D1 IFEQ DEBUG,1
  149. LT B2,B4,MRLS5 BUFWA GQ PREBUF AND
  150. LT B2,B7,MRLS15 BUFWA LS TEMP1, BRANCH TO MRLS15
  151.  
  152. MRLS5 LE B6,B5,MRLS10 TEMP2 GR FOBUF AND
  153. SB1 FRETAB+FRE1# FOBUF NQ LOC(FRE1)
  154. NE B5,B1,MRLS15 BRANCH TO MRLS15
  155.  
  156. MRLS10 SA5 CTLSFWA BUFWA LS CTLSFWA,
  157. SB1 X5 BRANCH TO MRLS15
  158. GE B2,B1,MRLS20
  159.  
  160. MRLS15 BSS 0
  161. SA1 MSGDR READ MSG CM ADDRESS
  162. RJ ABORT *---ABORT---*
  163. D1 ENDIF
  164.  
  165. ***
  166. *
  167. * LINK BUFFER TO THE FREE CHAIN
  168.  
  169. MRLS20 LX1 FRBBS?-FRBBS$+1 SHIFT TO APP POS IN WORD
  170. NE B2,B7,MRLSY BRANCH IF BUFWA NE TEMP1
  171. NE B5,B6,MRLSZ BRANCH IF FOBUF NE TEMP2
  172.  
  173. **
  174. *
  175. * CASE 1 RELEASE BUF FORM CONTIGUOUS BLK WITH BOTH PRE AND FO BLKS
  176. *
  177. * FOLLOWING INSTRUCTIONS PRESERVES:
  178. * (X7) = FRBBS[PREBIF]+FRBBS[BUFWA]+FRBBS[FOBUF]
  179. * (X3) = FRBWD[FOBUF]
  180.  
  181. MX0 -FRBBS$ MASK FOR FRBBS FIELD
  182. LOAD A5,B4,FRBBS# (X5)=FRBBS[PREBUF] WORD
  183. LX0 FRBBS?-FRBBS$+1 SHIFT TO APPR POS IN WORD
  184. BX7 X0*X5 REST OF WORD MINUS FRBBS FD
  185. BX5 -X0*X5 GET FRBBS FIELD FROM WORD FRBBS[PREBUF]
  186. LOAD A3,B5,FRBBS# (X3)=FRBBS[FOBUF] WORD
  187. BX6 -X0*X3 GET FRBBS FIELD FROM WORD FRBBS[FOBUF]
  188. IX5 X5+X1 ADD FRBBS[PREBUF] AND FRBBS[BUFWA]
  189. IX5 X5+X6 ADD RESULT AND FRBBS[FOBUF]
  190. BX7 X7+X5 INTEGRATE THE RESULTING FRBWD[PREBUF]
  191.  
  192. SB7 X3 TEMP1=FRBFBFP[FOBUF]
  193. MX0 -FRBFBFP$ MASK FOR FRBFBFP FD
  194. BX7 X0*X7 FRBFBFP[PREBUF] WORD MINUS FP FD
  195. SX0 B7 (X0)=FBFBFP[FOBUF]
  196. LOAD A5,B7,FRBFBBP# (X5)=FRBFBBP[FRBFBFP[FOBUF]] WORD
  197. BX7 X7+X0 (X7)=FRBFBFP[FOBUF]+ORIGINAL FRBWPLPREBUF]
  198. MX4 -FRBFBBP$ MASK FOR FRBFBBP
  199. STORE A7,B4,FRBWD# (X7)=FRBWD[PREBUF]
  200. LX4 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  201. SX3 B4 (X3)=PREBUF VALUE
  202. BX6 X4*X5 (X6)=FRBWD[FRBFBFP[FOBUF]] MINUS FRBFBBP FD
  203. LX3 FRBFBBP?-FRBFBBP$+1 SHIFT FRBFBBP FD TO RIGHT POS
  204. BX6 X6+X3 FRBFBBP[FRBFBFP[FOBUF]]=PREBUF
  205. SA6 A5 STORE FRBFBBP[FRBFBFP[FOBUF]] TO CM
  206. SX7 B3-1 (X7)=FRENOFB-1
  207. SA7 FRETAB+FRENOFB# STORE FRENOFB TO CM
  208. EQ MEXIT
  209.  
  210. **
  211. *
  212. * CASE 2 RELEASE BLK FOR, CONTIGUOUS BLK WITH PECEEDING BLK ONLY
  213.  
  214. MRLSZ MX0 -FRBBS$ MASK FOR FRBBS FIELD
  215. LOAD A5,B4,FRBBS# (X5)=FRBBS[PREBUF] WORD
  216. LX0 FRBBS?-FRBBS$+1 SHIFT TO APPR POS IN WORD
  217. BX4 -X0*X5 (X4)=FRBBS[PREBUF] ONLY
  218. BX5 X0*X5 (X5)=FRBBS[PREBUF] WORD MINUS FRBBS[PREBUF]
  219. IX7 X4+X1 (X7)=FRBBS[PREBUF]+FRBBS[BUFWA]
  220. BX7 X7+X5 (X7)=FRBWD[PREBUF] RESULT
  221. SA7 A5 FRBBS[PREBUF]=FRBBS[PREBUF]+FRBBS[BUFWA]
  222. EQ MEXIT
  223.  
  224. **
  225. *
  226. * CASE 3 RELEASE BLK FORM CONTIGUOUS BLK WITH FOLLOWING BLK ONLY
  227.  
  228. MRLSY NE B5,B6,MRLSX BRANCH IF FOBUF NE TEMP2
  229. MX0 -FRBBS$ MASK FOR FRBBS FIELD
  230. LX0 FRBBS?-FRBBS$+1 SHIFT TO APPR POS IN WORD
  231. LOAD A3,B5,FRBBS# (X3)=FRBBS[FOBUF] WORD
  232. BX6 -X0*X3 (X6)=FRBBS[FOBUF] ONLY
  233. BX5 X0*X3 (X5)=FRBWD[BUFWA] MINUS FRBBS[BUFWA]
  234. IX6 X6+X1 (X6)=FRBBS[BUFWA]+FRBBS[FOBUF] NOT JUST.
  235. BX6 X6+X5 (X6)=RESULT TO BE STORE IN FRBWD[BUFWA]
  236. SA6 X2 STORE NEW FRBWD[BUFWA] TO CM
  237. SB7 X3 (B7)=FRBFBFP[FOBUF] TEMP1
  238. LOAD A1,B4,FRBFBFP# (X1)=FRBFBFP[PREBUF] WORD
  239. MX7 -FRBFBFP$ MASK FOR FRBFBFP FD
  240. BX7 X7*X1 FRBFBFP[PREBUF] WORD MINUS FP FD
  241. BX7 X7+X2 (X7)=NEW FRBWD[PREBUF], FP SET BUFWA
  242. MX4 -FRBFBBP$ MASK FOR FRBFBBP FIELD
  243. SA7 A1 STORE NEW FRBWD[PREBUF]
  244. LX4 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  245. LOAD A5,B7,FRBFBBP# (X5)=FRBFBBP[FRBFBFP[FOBUF]] WORD
  246. BX5 X4*X5 FRBWD[FRBFBFP[FOBUF]] MINUS FRBFBBP FIELD
  247. LX2 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  248. BX6 X5+X2 NEW FRBWD[FRBFBFP[FOBUF]]
  249. SA6 A5 STORE TO CM
  250. EQ MEXIT
  251.  
  252. **
  253. *
  254. * CASE 4 RELEASE BUFFER DOES NOT FORM CONTIGUOUS BLOCK WITH ANY BLK
  255.  
  256. MRLSX SX3 B4 (X3)=PREBUF VALUE
  257. LX3 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  258. BX1 X1+X3 FRBFBBP[BUFWA]=PREBUF
  259. SB3 B3+1 FRENOFB=FRENOFB+1
  260. SX5 B5 (X5)=FOBUF
  261. BX6 X1+X5 FRBFBFP[BUFWA]=FOBUF
  262. STORE A6,B2,FRBWD# (X6)=NEW FRBWD[BUFWA]
  263. MX0 -FRBFBFP$ MASK FOR FRBFBFP FD
  264. LOAD A4,B4,FRBFBFP# (X4)=FRBFBFP[PREBUF] WORD
  265. BX4 X0*X4 FRBFBFP[PREBUF] WORD MINUS FP FD
  266. SX6 B3 (X6)=UPDATED FRENOFB
  267. BX7 X4+X2 FRBFBFP[PREBUF]=BUFWA
  268. SA7 A4 STORE TO CM
  269. SA6 FRETAB+FRENOFB# STORE TO CM
  270. MX0 -FRBFBBP$ MASK FOR FRBFBBP
  271. LOAD A5,B5,FRBFBBP# (X5)=FRBFBBP[FOBUF] WORD
  272. LX0 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  273. BX5 X0*X5 REST OF WORD MINUS FRBFBBP[FOBUF] FD
  274. LX2 FRBFBBP?-FRBFBBP$+1 SHIFT TO APPR POS IN WORD
  275. BX7 X5+X2 FRBFBBP[FOBUF]=BUFWA
  276. SA7 A5 STORE RESULT TO CM
  277.  
  278. MEXIT BSS 0
  279.  
  280. IFEQ BFSC,1,1
  281. RJ BFSCAN
  282. EQ MRELSX EXIT
  283.  
  284. IFEQ DEBUG,1,2
  285. MSGDR VFD 60/MSGBLK
  286. BSSZ 1
  287. XMRELS DATA L*MRELS*
  288. TEMP BSS 1
  289. MSGBLK DATA L*MRELS BUFFER MANAGEMENT ERROR*
  290.  
  291.  
  292.  
  293. END
cdc/nos2.source/nam5871/mrels.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator