*DECK MSEIZE
IDENT MSEIZE
ENTRY MSEIZE
EXT ABORT
EXT BFSCAN
EXT OMSG
EXT RDUMP
EXT XDROP
EXT XTRACE
LIST F
*IF DEF,IMS
*#
*
* 1. PROC NAME AUTHOR DATE
* MSEIZE P.C.TAM 77/11/28
*
* 2. FUNCTIONAL DESCRIPTION.
* DELINK A FREE BUFFER FROM FREE CHAIN
*
* 3. METHOD USED.
* DELINK BUFFER FROM FREE CHAIN
* DECREMENT FRESFB BY REQUIRED SIZE
* RELEASE ANY EXTRA SPACE
*
* 4. ENTRY PARAMETERS.
* (A0)=ADDR OF PARM BLOCK
* (X1)=RQSIZE
* (B4)=BUFWA OF FREE BUFFER
*
* 5. EXIT PARAMETERS.
* NONE.
*
* 6. COMMON DECKS CALLED.
* CYBERDEFS FREETAB INPARU MACDEF STATTAB2
*
* 7. ROUTINES CALLED.
* OMSG ISSUE DAYFILE MESSAGE
* RDUMP DUMP NIP-S FIELD LENGTH
* XDROP SET PIP-DROP FLAG AND TERMINATE
* XTRACE RECORD PROCEDURE CALLS
*
* 8. DAYFILE MESSAGES.
* *MGETS BUFFER MANAGEMENT ERROR*
*
*#
*ENDIF
*CALL MACDEF
*CALL INPARU
*CALL CYBERDEFS
*CALL FREETAB
*CALL STATTAB2
MSEIZE SUBR = ENTRY/EXIT
D1 IFEQ DEBUG,1,6
SX6 A1
SA6 TEMP
SX1 XMSEIZ
RJ XTRACE
SA1 TEMP
SA1 X1
NZ X1,MSZ1
IFEQ DEBUG,1,2
SA1 MSGADR
RJ ABORT *---ABORT---*
MSZ1 BSS 0
D1 ENDIF
IFEQ STAT,1,4
MX0 -1 INCREMENT ST$GET
SA5 ST$GET
IX7 X5-X0
SA7 A5
SA2 FRETAB+FRESFB# (X2)=(FRESFB)
SA3 FRETAB+FRENOFB# (X3)=(FRENOFB)
***
*
* FOUND, UPDATE FREETAB INFO, DELINK SELECTED BUF, RELEASE EXTRA
MX0 -FRBBS$ (X0)=MASK FOR FRBBS
LX0 FRBBS?-FRBBS$+1 (X0)= FRBBS SHIFTED TO APPR POS
LOAD A5,B4,FRBBS# (X5)=FRBBS[BUFWA] WORD
BX4 -X0*X5 (X4)=FRBBS[BUFWA] ONLY
LX4 -FRBBS?+FRBBS$-1 RIGHT JUST. FRBBS[BUFWA]
SB1 X5 (B1)=FRBFBFP[BUFWA] (TEMP1)
LX5 -FRBFBFP$ (X5)=FRBFBBP[BUFWA] RIGHT JUSTIFY
SB2 X5 (B2)=FRBFBBP[BUFWA] (TEMP2)
IX4 X4-X1 (X4)=FRBBS[BUFWA]-RQSIZE
SB3 X4 EXTRA SPACE LEFT IN SELECTED BUFFER
ZR X4,MGTSZA BRANCH IF FRBBS[BUFWA]-RQSIZE IS 0
* EXTRA SPACE TO RELEASE
LX5 FRBFBFP$ RESTORE ORIGINAL X5
MX0 -FRBFBBP$-FRBFBFP$ MASK FOR FRBFBBP AND FRBFBFP TOGETHER
LX4 FRBBS?-FRBBS$+1 SHIFT TO APP POS IN WORD
BX7 -X0*X5 (X7)=FRBWD[BUFWA] MINUS FRBID FRBBS
SB7 B4+X1 (B7)=BUFWA+ RQSIZE
BX7 X7+X4 (X7)=NEW FRBWD[BUFWA+RQSIZE]
SA7 B7 WRITE TO CM
SX4 B7 (X4)=BUFWA+RQSIZE
SX5 B7 (X4)=BUFWA+RQSIZE
EQ MGTSZB
* NO EXTRA SPACE TO RELEASE
MGTSZA SX4 B1 (X4)=FRBFBFP[BUFWA]
SX5 B2 (X5)=FRBFBBP[BUFWA] RIGHT JUSTIFIED
SX3 X3-1 (X3)= UPDATED FRENOFB
MGTSZB BSS 0
IX6 X2-X1 (X6)=FRESFB-RQSIZE
BX7 X3 (X7)=UPDATED FRENOFB
SA6 FRETAB+FRESFB#
SA7 FRETAB+FRENOFB#
MX0 -FRBFBBP$ MASK FOR FRBFBBP FD
LOAD A2,B1,FRBFBBP# (X2)=FRBFBBP[FRBFBFP[BUFWA]] WORD
LX0 FRBFBBP?-FRBFBBP$+1 SHIFT MASK TO APPR POS IN WORD
BX2 X0*X2 (X2)=FRBFBBP[FRBFBFP[BUFWA]] WORD MINUS BP
LX5 FRBFBBP?-FRBFBBP$+1 SHIFT TO APP POS IN WORD
BX7 X5+X2 FRBFBBP[FRBFBFP[BUFWA]]=FRBFBBP[BUFWA]
SA7 A2 STORE BACK TO CM
MX0 -FRBFBFP$ MASK FOR FRBFBFP FD
LOAD A3,B2,FRBFBFP# (X3)=FRBFBFP[FRBFBBP[BUFWA]] WORD
BX3 X0*X3 (X3)=FRBFBFP[FRBFBBP[BUFWA]] WORD MINUS FP
BX6 X4+X3 FRBFBFP[FRBFBBP[BUFWA]]=FRBFBFP[BUFWA]
SA6 A3 STORE TO CM
* CHECK IF HOST REGULATION LEVEL NEEDS TO BE UPDATED
* (A2) = ADDR OF NEXT FREE BUFFER IN FREE CHAIN
* (B3) = EXTRA SPACE LEFT IN SELECTED BUFFER
SB6 FRETAB+FREFBBP# ADDR OF FREETAB BUFFER POINTER WORD
SB5 A2 ADDR OF NEXT BUFFER AFTER DELINKED FREE BUF
NE B6,B5,MGTS20 EXIT IF DELINKED BUF NOT FROM LAST BUF
SX3 B3 EXTRA SPACE LEFT IN LAST BUFFER
SA5 CTLSLWA LWA OF FIELD LENGTH
SA4 MAXFL MAX FIELD LENGTH FOR NIP
IX5 X5-X3 ADDR OF FIRST FREE WORD AT END OF MEMORY
IX4 X4-X5 CALCULATE SIZE OF LAST FREE BUFFER
SX7 HRLV3 PRESET TO HOST REGULATION LEVEL 3
SX5 BUFLV3 THRESHOLD FOR HOST REGULATION LEVEL 3
IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
SX7 HRLV2 SET TO HOST REGULATION LEVEL 2
SX5 BUFLV2 THRESHOLD FOR HOST REGULATION LEVEL 2
IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
SX7 HRLV1 SET TO HOST REGULATION LEVEL 1
SX5 BUFLV1 THRESHOLD FOR HOST REGULATION LEVEL 1
IX5 X4-X5 SIZE DIFFERENCE BETWEEN LAST BUF AND THRESH
PL X5,MGTS15 EXIT IF LAST BUFFER GREATER THAN THRESHOLD
SX7 HRLV0 SET TO HOST REGULATION LEVEL 0
MGTS15 SA7 HRL SAVE NEW HOST REGULATION LEVEL
***
*
* ZERO OUT BUF IF NECESSARY
MGTS20 SA3 A0+2 (X3)=ZERO FLAG ADDR
SA3 X3 (X3)=ZERO FLAG
ZR X3,MGTS30 FLAG NOT SET, NO ZEROING
SB1 1
MX7 0 (X7)=0
SB6 X1-1 (B6)=RQSIZE-1
SB7 X7
MGTS25 SA7 B4+B7 CMWORD[BUFWA+B7]=0
SB7 B7+B1
LE B7,B6,MGTS25 CHECK FOR EXIT
MGTS30 LX1 FRBBS?-FRBBS$+1 SHIFT RQSIZE TO APPRO POS IN WORD
BX6 X1 FRBLKS[BUFWA]=RQSIZE
STORE A6,B4,FRBBS# WRITE FRBBS[BUFWA] BACK
IFEQ BFSC,1,1
RJ BFSCAN
EQ MSEIZEX EXIT
MSFZ IFEQ DEBUG,1
MSGADR VFD 60/MSGE
BSSZ 1
MSGE DATA L*MGETS BUFFER MANAGEMENT ERROR*
XMSEIZ DATA L*MSEIZ*
TEMP BSS 1
MSFZ ENDIF
END