User Tools

Site Tools


cdc:nos2.source:nam5871:exgitsb

EXGITSB

Table Of Contents

Source Code

EXGITSB.txt
  1. *DECK EXGITSB
  2. PROC GIVETSB ( (FWA) );
  3. BEGIN # GIVETSB #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * GIVETSB M. D. PICKARD 76/11/19
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * GIVETSB WILL RETURN AN ASSIGNED BLOCK TO THE AVAILABLE
  13. * SPACE IN THE TSB AREA.
  14. *
  15. * 3. METHOD USED
  16. * THE TSB IS SET TO FREE. THE TSB PRECEEDING IT AND AFTER IT
  17. * ARE CHECKED, IF TWO FREE TSB"S ARE CONTIGUOUS THEY ARE MADE
  18. * INTO ONE BLOCK.
  19. *
  20. * 4. ENTRY PARAMETERS
  21. * A. FORMAL PARAMETERS
  22. * FWA ADDRESS OF TSB BEING RETURNED
  23. *
  24. * B. TSBMGR GLOBAL PARAMETERS
  25. * CTSBLWA CURRENT LAST WORD ADDRESS OF TSB"S
  26. * TSBFWA TSB AREA FIRST WORD ADDRESS
  27. *
  28. * 5. EXIT PARAMETERS
  29. * FFFWA (TSBMGR GLOBAL) FIRST FREE TSB ADDRESS
  30. * BIGFREE (TSBMGR GLOBAL) BIGGEST FREE TSB IN TSB AREA
  31. *
  32. * 6. COMDECKS CALLED
  33. * TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
  34. * TSBDATA TSB MANAGER DATA AREA DEFINITIONS
  35. * TSBDEFS TSB MANAGER SYMPL DEFS
  36. *
  37. * 7. ROUTINES CALLED
  38. * GETBIG GET BIGGEST FREE TSB
  39. * FIRSTF GET FIRST FREE TSB
  40. *
  41. * 8. DAYFILE MESSAGES
  42. * NONE.
  43. *
  44. #
  45. *ENDIF
  46. CONTROL NOLIST; # STOPS LIST TSBDEFS,TSBDATA,TSBBASE #
  47. *CALL CYBERDEFS
  48. *CALL TSBDEFS
  49. *CALL TSBBASE
  50. *CALL TSBDATA
  51. CONTROL LIST;
  52. ITEM
  53. FWA U; # FWA OF TSB BEING GIVEN BACK #
  54. XREF
  55. BEGIN
  56. PROC FIRSTF;
  57. PROC GETBIG;
  58. END
  59. ITEM
  60. TEMPA U, # TEMPORARY ADDRESS FOR TSB"S #
  61. TEMPL U; # TEMPORARY LENGTH OF ACCUMULATED TSB #
  62. P<FTSBHDR> = FWA; # SET FREE HEADER AT RELEASED TSB #
  63. TEMPL = FTSBL[0]; # SAVE AMOUNT BEING RETURNED #
  64. FBUSY[0] = FALSE; # SET NOT BUSY #
  65. FIDENT[0] = 0; # CLEAR IDENT FIELD #
  66. FNOTMOV[0] = FALSE; # ALLOW MOVING #
  67. IF FPTSBL[0] NQ 0
  68. THEN # THERE IS A TSB BEFORE THIS #
  69. BEGIN
  70. TEMPA = FWA - FPTSBL[0]; # ADDRESS OF PREVIOUS TSB #
  71. P<FTSBHDR> = TEMPA; # SET FREE HEADER AT PREVIOUS TSB #
  72. IF FBUSY[0]
  73. THEN # TSB PREVIOUS TSB IS ASSIGNED #
  74. TEMPA = FWA; # RESET TO ORIGINAL FREE TSB FWA #
  75. ELSE
  76. TEMPL = TEMPL + FTSBL[0]; # ADD LENGTH OF BOTH TSB"S #
  77. END
  78. ELSE # SET ADDRESS TO TSB BEING GIVEN BACK #
  79. TEMPA = FWA;
  80. P<FTSBHDR> = TEMPA + TEMPL; # POINT TO NEXT TSB #
  81. IF LOC(FTSBHDR) LS CTSBLWA
  82. THEN # THERE IS A NEXT TSB (NOT AT END) #
  83. IF NOT FBUSY[0]
  84. THEN # IT IS FREE ALSO, COMBINE W/ THE REST #
  85. TEMPL = TEMPL + FTSBL[0]; # ADD LENGTH TO THAT ACCUMULATED #
  86. P<FTSBHDR> = TEMPA; # SET HEADER AT ADDRESS OF NEW FREE TSB #
  87. FTSBL[0] = TEMPL; # SET LENGTH #
  88. P<BTSBHDR> = TEMPA + TEMPL; # NEXT TSB #
  89. BPTSBL[0] = TEMPL; # SET NEW PREVIOUS TSB LENGTH #
  90. IF TEMPL GR BIGFREE THEN # RESET BIGFREE IF RETURNED #
  91. BIGFREE = TEMPL ; # VALUE IS GREATER #
  92. IF TEMPA LS FFFWA THEN #RESET FFFWA IF RETURNED IS LOWER #
  93. FFFWA = TEMPA ;
  94. RETURN;
  95. END TERM # GIVETSB #
cdc/nos2.source/nam5871/exgitsb.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator