User Tools

Site Tools


cdc:nos2.source:nam5871:mgrow

Table of Contents

MGROW

Table Of Contents

Source Code

MGROW.txt
  1. *DECK MGROW
  2. IDENT MGROW
  3. LIST F
  4. ENTRY MGROW
  5. EXT ABORT
  6. EXT MGETS
  7. EXT MRELS
  8. EXT OMOVE
  9. EXT XTRACE
  10. *IF DEF,IMS
  11. *#
  12. *1DC MGROW
  13. * 1. PROC NAME AUTHOR DATE
  14. * MGROW P.C.TAM 78/07/05
  15. *
  16. * 2. FUNCTIONAL DESCRIPTION.
  17. * EXPAND THE SIZE OF A BUFFER.
  18. *
  19. * 3. METHOD USED.
  20. * WITH DEBUG ON, MGROW WILL CHECK IF BLOCK SIZE IS ZERO,
  21. * IF REQUESTED SIZE IS ZERO, OR IF REQUESTED SIZE IS
  22. * SMALLER THAN BLOCK SIZE. MGROW WILL ABORT ON THOSE
  23. * CONDITIONS.
  24. * MGROW WILL GET A BUFFER OF REQUESTED SIZE, MOVE
  25. * INFORMATION TO NEW BLOCK, AND RELEASE OLD BUFFER.
  26. *
  27. * 4. ENTRY PARAMETER.
  28. * (A1) = ADDRESS OF THE ADDRESS OF THE OLD BUFFER ADDRESS
  29. * (A1)+1 = ADDRESS OF THE ADDRESS OF THE REQUIRED SIZE
  30. *
  31. * 5. EXIT PARAMETER.
  32. * (A1) = ADDRESS OF THE ADDRESS OF NEW BUFFER ADDRESS
  33. * (A1)+2 = ADDRESS OF THE ADDRESS OF THE COMPLETE FLAG
  34. * FLAG SET TO 1 IF MOVE IS SUCCESSFUL
  35. *
  36. * 6. COMMON DECKS CALLED.
  37. * CYBERDEFS INPARU MACDEF FREETAB
  38. *
  39. * 7. ROUTINES CALLED.
  40. * ABORT ABORT NIP
  41. * MGETS ALLOCATE A BUFFER FROM FREE POOL
  42. * MRELS RELEASE A BUFFER TO FREE POOL
  43. * OMOVE MOVE INFORMATION
  44. * XTRACE TRACE CALLER
  45. *
  46. * 8. DAYFILE MESSAGES.
  47. * *MGROW CALL ERROR* - OLD OR NEW BLOCK ZERO SIZE,
  48. * NEW BLOCK SIZE LESS THAN OLD SIZE.
  49. *
  50. *#
  51. *ENDIF
  52.  
  53. *CALL MACDEF
  54. *CALL CYBERDEFS
  55. *CALL INPARU
  56. *CALL FREETAB
  57.  
  58. MGROW SUBR = ENTRY/EXIT
  59. SA2 X1 (X2)=BUFADDR
  60. SB1 1
  61. LOAD A3,X2,FRBBS# (X3)=HEADER WORD OF BUFADDR
  62. SA4 A1+B1 (X4)=REQUIRED SIZE
  63. LX3 -FRBBS?+FRBBS$-1 RIGHT JUSTIFY BLOCK SIZE
  64. SA4 X4
  65. SX5 X3
  66.  
  67. GRF2 IFEQ DEBUG,1
  68. IX6 X4-X5 REQUEST SIZE MINUS BLOCK SIZE
  69. MI X6,GRZ ERROR IF BLOCK SIZE GR NEW SIZE
  70. GRF2 ENDIF
  71.  
  72. SX7 A1 SAVE A1
  73. BX6 X4 SET UP PARM FOR MGETS CALL
  74. SA7 SAVEA1
  75. SA6 MGPM
  76. SA1 MGPMD
  77. RJ MGETS MGETS(SIZE, BUFAD, FALSE)
  78. SA1 SAVEA1
  79. SB1 1
  80. SA5 MGPM+1 (X5)=BUFAD
  81. SA1 X1
  82. SA2 A1+2 (X2)=ADDR OF 3RD PARM
  83. ZR X5,GRY BUFAD ZERO
  84.  
  85. **
  86. * GET NEW BUFFER
  87.  
  88. SX7 B1 COMPLETE=TRUE
  89. BX6 X5 (X6)=BUFAD
  90. SA7 X2
  91. SA2 X1 (X2)=BUFADDR
  92. SA6 X1 BUFADDR=BUFAD
  93. LOAD A3,X2,FRBBS# (X3)=HEADER WORD OF OLD BUFADDR
  94. SX7 X2+B1 MOLD=BUFADDR+1
  95. LX3 -FRBBS?+FRBBS$-1 RIGHT JUSTIFY BLOCK SIZE
  96. SX6 X5+B1 MNEW=BUFAD+1
  97. SA7 MOLD
  98. MX0 -1 (X0)=-1
  99. SA6 MNEW
  100. SX4 X3 (X4)=OLD BLOCK SIZE
  101. IX7 X4+X0 MSIZE=OLD BLOCK SIZE - 1
  102. SA7 MSIZE
  103. BX6 X3-X4 BUILD NEW HEADER
  104. LOAD A5,X5,FRBBS# (X5)=HEADER WORD OF BUFAD BUFFER
  105. BX7 X2 (X7)=OLD BUFFADR
  106. LX5 -FRBBS?+FRBBS$-1 RIGHT JUSTIFY BLOCK SIZE
  107. SA7 MRPM
  108. SX5 X5
  109. BX6 X6+X5
  110. SB2 A5
  111. LX6 FRBBS?-FRBBS$+1 NEW BLOCK HEADER FOR BUFAD
  112. SB3 B2+X4 (B3)=BUFAD+OLD BLOCK SIZE
  113. SA6 A5
  114. MX7 0
  115. SB4 B2+X5 (B4)=BUFAD+NEW BS
  116.  
  117. GRW GE B3,B4,GRX LOOP TO ZERO OUT REST OF BLOCK
  118. SA7 B3
  119. SB3 B3+B1
  120. EQ GRW
  121.  
  122. GRX BSS 0
  123. RJ OMOVE COPY INFORMATION FROM OLD BLOCK
  124. SA1 MRPMD
  125. RJ MRELS RELEASE OLD BLOCK
  126. EQ MGROWX RETURN
  127.  
  128. GRY BSS 0
  129. MX7 0
  130. SA7 X2 COMPLETE=FALSE
  131. EQ MGROWX
  132.  
  133. GRF5 IFEQ DEBUG,1
  134. GRZ BSS 0
  135. SA1 MSGDR
  136. RJ ABORT *----ABORT----*
  137.  
  138. MSGDR VFD 60/MSGD
  139. BSSZ 1
  140. MSGD DATA L*MGROW CALL ERROR*
  141. GRF5 ENDIF
  142.  
  143. MRPMD BSS 0
  144. MGPMD VFD 60/MGPM
  145. VFD 60/MGPM+1
  146. VFD 60/MGPM+2
  147. MRPM BSS 0
  148. MGPM BSSZ 3 SIZE, BUFAD, FALSE
  149. SAVEA1 BSSZ 1
  150.  
  151. END
  152.  
cdc/nos2.source/nam5871/mgrow.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator