User Tools

Site Tools


cdc:nos2.source:nam5871:mseize

MSEIZE

Table Of Contents

Source Code

MSEIZE.txt
  1. *DECK MSEIZE
  2. IDENT MSEIZE
  3. ENTRY MSEIZE
  4. EXT ABORT
  5. EXT BFSCAN
  6. EXT OMSG
  7. EXT RDUMP
  8. EXT XDROP
  9. EXT XTRACE
  10. LIST F
  11. *IF DEF,IMS
  12. *#
  13. *
  14. * 1. PROC NAME AUTHOR DATE
  15. * MSEIZE P.C.TAM 77/11/28
  16. *
  17. * 2. FUNCTIONAL DESCRIPTION.
  18. * DELINK A FREE BUFFER FROM FREE CHAIN
  19. *
  20. * 3. METHOD USED.
  21. * DELINK BUFFER FROM FREE CHAIN
  22. * DECREMENT FRESFB BY REQUIRED SIZE
  23. * RELEASE ANY EXTRA SPACE
  24. *
  25. * 4. ENTRY PARAMETERS.
  26. * (A0)=ADDR OF PARM BLOCK
  27. * (X1)=RQSIZE
  28. * (B4)=BUFWA OF FREE BUFFER
  29. *
  30. * 5. EXIT PARAMETERS.
  31. * NONE.
  32. *
  33. * 6. COMMON DECKS CALLED.
  34. * CYBERDEFS FREETAB INPARU MACDEF STATTAB2
  35. *
  36. * 7. ROUTINES CALLED.
  37. * OMSG ISSUE DAYFILE MESSAGE
  38. * RDUMP DUMP NIP-S FIELD LENGTH
  39. * XDROP SET PIP-DROP FLAG AND TERMINATE
  40. * XTRACE RECORD PROCEDURE CALLS
  41. *
  42. * 8. DAYFILE MESSAGES.
  43. * *MGETS BUFFER MANAGEMENT ERROR*
  44. *
  45. *#
  46. *ENDIF
  47.  
  48. *CALL MACDEF
  49. *CALL INPARU
  50. *CALL CYBERDEFS
  51. *CALL FREETAB
  52. *CALL STATTAB2
  53.  
  54. MSEIZE SUBR = ENTRY/EXIT
  55.  
  56. D1 IFEQ DEBUG,1,6
  57. SX6 A1
  58. SA6 TEMP
  59. SX1 XMSEIZ
  60. RJ XTRACE
  61. SA1 TEMP
  62. SA1 X1
  63.  
  64. NZ X1,MSZ1
  65. IFEQ DEBUG,1,2
  66. SA1 MSGADR
  67. RJ ABORT *---ABORT---*
  68.  
  69. MSZ1 BSS 0
  70. D1 ENDIF
  71.  
  72. IFEQ STAT,1,4
  73. MX0 -1 INCREMENT ST$GET
  74. SA5 ST$GET
  75. IX7 X5-X0
  76. SA7 A5
  77.  
  78. SA2 FRETAB+FRESFB# (X2)=(FRESFB)
  79. SA3 FRETAB+FRENOFB# (X3)=(FRENOFB)
  80.  
  81. ***
  82. *
  83. * FOUND, UPDATE FREETAB INFO, DELINK SELECTED BUF, RELEASE EXTRA
  84.  
  85. MX0 -FRBBS$ (X0)=MASK FOR FRBBS
  86. LX0 FRBBS?-FRBBS$+1 (X0)= FRBBS SHIFTED TO APPR POS
  87. LOAD A5,B4,FRBBS# (X5)=FRBBS[BUFWA] WORD
  88. BX4 -X0*X5 (X4)=FRBBS[BUFWA] ONLY
  89. LX4 -FRBBS?+FRBBS$-1 RIGHT JUST. FRBBS[BUFWA]
  90. SB1 X5 (B1)=FRBFBFP[BUFWA] (TEMP1)
  91. LX5 -FRBFBFP$ (X5)=FRBFBBP[BUFWA] RIGHT JUSTIFY
  92. SB2 X5 (B2)=FRBFBBP[BUFWA] (TEMP2)
  93. IX4 X4-X1 (X4)=FRBBS[BUFWA]-RQSIZE
  94. SB3 X4 EXTRA SPACE LEFT IN SELECTED BUFFER
  95. ZR X4,MGTSZA BRANCH IF FRBBS[BUFWA]-RQSIZE IS 0
  96.  
  97. * EXTRA SPACE TO RELEASE
  98.  
  99. LX5 FRBFBFP$ RESTORE ORIGINAL X5
  100. MX0 -FRBFBBP$-FRBFBFP$ MASK FOR FRBFBBP AND FRBFBFP TOGETHER
  101. LX4 FRBBS?-FRBBS$+1 SHIFT TO APP POS IN WORD
  102. BX7 -X0*X5 (X7)=FRBWD[BUFWA] MINUS FRBID FRBBS
  103. SB7 B4+X1 (B7)=BUFWA+ RQSIZE
  104. BX7 X7+X4 (X7)=NEW FRBWD[BUFWA+RQSIZE]
  105. SA7 B7 WRITE TO CM
  106. SX4 B7 (X4)=BUFWA+RQSIZE
  107. SX5 B7 (X4)=BUFWA+RQSIZE
  108. EQ MGTSZB
  109.  
  110. * NO EXTRA SPACE TO RELEASE
  111.  
  112. MGTSZA SX4 B1 (X4)=FRBFBFP[BUFWA]
  113. SX5 B2 (X5)=FRBFBBP[BUFWA] RIGHT JUSTIFIED
  114. SX3 X3-1 (X3)= UPDATED FRENOFB
  115.  
  116. MGTSZB BSS 0
  117. IX6 X2-X1 (X6)=FRESFB-RQSIZE
  118. BX7 X3 (X7)=UPDATED FRENOFB
  119. SA6 FRETAB+FRESFB#
  120. SA7 FRETAB+FRENOFB#
  121. MX0 -FRBFBBP$ MASK FOR FRBFBBP FD
  122. LOAD A2,B1,FRBFBBP# (X2)=FRBFBBP[FRBFBFP[BUFWA]] WORD
  123. LX0 FRBFBBP?-FRBFBBP$+1 SHIFT MASK TO APPR POS IN WORD
  124. BX2 X0*X2 (X2)=FRBFBBP[FRBFBFP[BUFWA]] WORD MINUS BP
  125. LX5 FRBFBBP?-FRBFBBP$+1 SHIFT TO APP POS IN WORD
  126. BX7 X5+X2 FRBFBBP[FRBFBFP[BUFWA]]=FRBFBBP[BUFWA]
  127. SA7 A2 STORE BACK TO CM
  128. MX0 -FRBFBFP$ MASK FOR FRBFBFP FD
  129. LOAD A3,B2,FRBFBFP# (X3)=FRBFBFP[FRBFBBP[BUFWA]] WORD
  130. BX3 X0*X3 (X3)=FRBFBFP[FRBFBBP[BUFWA]] WORD MINUS FP
  131. BX6 X4+X3 FRBFBFP[FRBFBBP[BUFWA]]=FRBFBFP[BUFWA]
  132. SA6 A3 STORE TO CM
  133.  
  134. * CHECK IF HOST REGULATION LEVEL NEEDS TO BE UPDATED
  135.  
  136. * (A2) = ADDR OF NEXT FREE BUFFER IN FREE CHAIN
  137. * (B3) = EXTRA SPACE LEFT IN SELECTED BUFFER
  138.  
  139. SB6 FRETAB+FREFBBP# ADDR OF FREETAB BUFFER POINTER WORD
  140. SB5 A2 ADDR OF NEXT BUFFER AFTER DELINKED FREE BUF
  141. NE B6,B5,MGTS20 EXIT IF DELINKED BUF NOT FROM LAST BUF
  142. SX3 B3 EXTRA SPACE LEFT IN LAST BUFFER
  143. SA5 CTLSLWA LWA OF FIELD LENGTH
  144. SA4 MAXFL MAX FIELD LENGTH FOR NIP
  145. IX5 X5-X3 ADDR OF FIRST FREE WORD AT END OF MEMORY
  146. IX4 X4-X5 CALCULATE SIZE OF LAST FREE BUFFER
  147. SX7 HRLV3 PRESET TO HOST REGULATION LEVEL 3
  148. SX5 BUFLV3 THRESHOLD FOR HOST REGULATION LEVEL 3
  149. IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
  150. PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
  151. SX7 HRLV2 SET TO HOST REGULATION LEVEL 2
  152. SX5 BUFLV2 THRESHOLD FOR HOST REGULATION LEVEL 2
  153. IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
  154. PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
  155. SX7 HRLV1 SET TO HOST REGULATION LEVEL 1
  156. SX5 BUFLV1 THRESHOLD FOR HOST REGULATION LEVEL 1
  157. IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
  158. PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
  159. SX7 HRLV0 SET TO HOST REGULATION LEVEL 0
  160. MGTS15 SA7 HRL SAVE NEW HOST REGULATION LEVEL
  161.  
  162. ***
  163. *
  164. * ZERO OUT BUF IF NECESSARY
  165.  
  166. MGTS20 SA3 A0+2 (X3)=ZERO FLAG ADDR
  167. SA3 X3 (X3)=ZERO FLAG
  168.  
  169. ZR X3,MGTS30 FLAG NOT SET, NO ZEROING
  170. SB1 1
  171. MX7 0 (X7)=0
  172. SB6 X1-1 (B6)=RQSIZE-1
  173. SB7 X7
  174.  
  175. MGTS25 SA7 B4+B7 CMWORD[BUFWA+B7]=0
  176. SB7 B7+B1
  177. LE B7,B6,MGTS25 CHECK FOR EXIT
  178.  
  179. MGTS30 LX1 FRBBS?-FRBBS$+1 SHIFT RQSIZE TO APPRO POS IN WORD
  180. BX6 X1 FRBLKS[BUFWA]=RQSIZE
  181. STORE A6,B4,FRBBS# WRITE FRBBS[BUFWA] BACK
  182.  
  183. IFEQ BFSC,1,1
  184. RJ BFSCAN
  185.  
  186. EQ MSEIZEX EXIT
  187.  
  188.  
  189. MSFZ IFEQ DEBUG,1
  190. MSGADR VFD 60/MSGE
  191. BSSZ 1
  192. MSGE DATA L*MGETS BUFFER MANAGEMENT ERROR*
  193. XMSEIZ DATA L*MSEIZ*
  194. TEMP BSS 1
  195. MSFZ ENDIF
  196.  
  197. END
cdc/nos2.source/nam5871/mseize.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator