User Tools

Site Tools


cdc:nos2.source:nam5871:extinit

EXTINIT

Table Of Contents

Source Code

EXTINIT.txt
  1. *DECK EXTINIT
  2. PROC TSBINIT;
  3. BEGIN # TSBINIT #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * TSBINIT M. D. PICKARD 77/01/03
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * TSBINIT WILL PERFORM THE INITIALIZATION OF THE DYNAMIC
  13. * MEMORY FOR THIS CONTROL POINT SO THAT THE TSB MANAGER
  14. * CAN MANAGE THIS AREA.
  15. *
  16. * 3. METHOD USED
  17. * THE EXISTANCE OF A 54 TABLE IS ESTABLISHED. ENOUGH FIELD
  18. * LENGTH FOR ANY OVERLAY AND THE TSB AREA IS REQUESTED. THE
  19. * INITIAL TSB AREA IS SET UP TO CONTAIN THE INITIAL TSB
  20. * INFORMATION TABLE (TSBIT) AND A FREE TSB.
  21. *
  22. * 4. ENTRY PARAMETERS
  23. * HHA FROM LOADER 54 TABLE, HIGHEST HIGH ADDRESS
  24. *
  25. * 5. EXIT PARAMETERS
  26. * NONE.
  27. *
  28. * 6. COMDECKS CALLED
  29. * TSBDEFS TSB MANAGER SYMPL DEFS
  30. * TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
  31. * TSBDATA TSB MANAGER DATA AREA DEFINITIONS
  32. *
  33. * 7. ROUTINES CALLED
  34. * ABORT ABORT THE CONTROL POINT, GOES TO EXIT
  35. * MEMORY REQUESTS MEMORY FROM OPERATING SYSTEM
  36. * MESSAGE ISSUE DAYFILE MESSAGES
  37. *
  38. * 8. DAYFILE MESSAGES
  39. * "54 TABLE NOT PRESENT" INFORMATIVE MESSAGE
  40. *
  41. #
  42. *ENDIF
  43. CONTROL NOLIST; # STOP LISTING OF TSBM COMMON DECKS #
  44. *CALL CYBERDEFS
  45. *CALL TSBDEFS
  46. *CALL TSBBASE
  47. *CALL TSBDATA
  48. CONTROL LIST;
  49. XREF
  50. BEGIN
  51. PROC ABORT;
  52. PROC MESSAGE;
  53. PROC MEMORY;
  54. PROC ZERO ;
  55. END
  56. DEF LDADDR # O"100" #; # LOAD ADDRESS #
  57. DEF LOCAL # 3 #; # SEND MESSAGE TO LOCAL DAYFILE #
  58. DEF ITSBSIZ # ( 2 * TSBITL ) #; # INITIAL TSB AREA SIZE #
  59. ITEM
  60. I U, # INDUCTION VARIABLE #
  61. TEMP U, # TEMPORARY UNSIGNED INTEGER #
  62. TYPE C(WC) = "CM "; # TYPE OF MEMORY REQUEST #
  63. BASED
  64. BEGIN
  65. ARRAY LDR54 P(5); # LOADER 54 TABLE FORMAT #
  66. ITEM
  67. LDRTYPE U (0,0,12), # LOADER TABLE TYPE FIELD #
  68. LDRHHA U (4,ZL,AL); # LOADER HIGHEST HIGH ADDRESS #
  69. END
  70. ARRAY ERR54 P(3); # 54 TABLE ERROR MESSAGE #
  71. ITEM
  72. ERR54MSG C (0,0,20) = [ "54 TABLE NOT PRESENT" ],
  73. ERR54Z U (2,0,WL) = [ 0 ];
  74. ARRAY STATIS P(1); # STATUS WORD PASSED TO MEMORY #
  75. ITEM
  76. REQFL U (0,0,HWL), # REQUEST FIELD LENGTH #
  77. REQZERO U (0,HWL,HWL); # LOWER HALF OF STATUS WORD #
  78. P<LDR54> = LDADDR; # FORMAT 54 TABLE #
  79. IF LDRTYPE[0] NQ O"5400"
  80. THEN # NOT 54 TABLE, TSBM INITIALIZATION NOT #
  81. BEGIN # SET FOR ANYTHING BUT 54 TABLE #
  82. MESSAGE(ERR54,LOCAL);# ISSUE LOCAL DAYFILE MESSAGE #
  83. ABORT; # ***** ABORT THE PROGRAM ***** #
  84. END
  85. REQZERO[0] = 0; # CLEAR PART OF STATUS WORD #
  86. REQFL[0] = LDRHHA[0] + ITSBSIZ + 9; # GET ENOUGH FOR ALL OVERLAYS#
  87. # AND THE INITIAL TSB AREA #
  88. # AND A LITTLE EXTRA FOR MOVE#
  89. # MACRO #
  90. MEMORY(TYPE,STATIS); # REQUEST THAT MUCH MEMORY #
  91. CTSBLWA = REQFL[0] - 9; # SET CURRENT TSB AREA LWA #
  92. PTSBLWA = CTSBLWA; # SET PRIMARY TSB LAST WORD ADDRESS #
  93. TSBFWA = LDRHHA[0]; # SET TSB AREA FIRST WORD ADDRESS #
  94. P<TSBS> = TSBFWA; # FORMAT TSB AREA FOR WORD ACCESS #
  95. #
  96. BUILD TSBIT IN FIRST TSB
  97. #
  98. P<BTSBHDR> = TSBFWA; # BUILD BUSY TSB FOR TSBIT AT TSBFWA #
  99. BBUSY[0] =TRUE; # BUSY TSB #
  100. BNOTMOV[0] = FALSE; # SET MOVEABLE BLOCK #
  101. BHDRRSV[0] = 0; # CLEAR RESERVED AREA #
  102. BIDENT[0] = 1; # 1 IS ALWAYS TSBIT TSBN #
  103. BPTSBL[0] = 0; # NOTHING PREVIOUS TO THIS TSB #
  104. BTSBL[0] = TSBITL + TSBHDRL; # SIZE OF TSB #
  105. P<TSBIT> = TSBFWA + TSBHDRL; # FORMAT TSBIT A USER AREA FWA #
  106. TSBITRSV[0] = 0; # CLEAR TSBIT HEADER RESERVED #
  107. LOWFREE[0] = 2; # SET INITIAL LOWEST FREE TSBIT ENTRY #
  108. LENGTH[0] = TSBITL; # SET INITIAL LENGTH OF TSBIT #
  109. NUMFREE[0] = TSBITL - 2; # NUMBER OF AVAILABLE ENTRIES #
  110. FOR I = LOWFREE[0] STEP 1 UNTIL ( LENGTH[0] - 1 ) DO
  111. BEGIN # SET UP INITIAL TSBIT ENTRIES #
  112. TRSVD[I] = 0; # CLEAR RESERVED AREA #
  113. TBUSY[I] = FALSE; # FREE TSBIT ENTRY #
  114. TTSBFWA[I] = 0; # CLEAR TSB ADDRESS #
  115. FWDPTR[I] = I + 1; # SET FORWARD POINTER #
  116. END
  117. FWDPTR[LENGTH[0] - 1] = 0; # SET END OF FREE CHAIN #
  118. TBUSY[1] = TRUE; # SET TSBIT IDENT AS BUSY #
  119. TRSVD[1] = 0; # CLEAR THE RESERVED AREA #
  120. TTSBFWA[1] = TSBFWA; # SET ADDRESS OF TSBIT TSB #
  121. FWDPTR[1] = 0; # CLEAR THE FORWARD POINTER #
  122. #
  123. BUILD FREE TSB WITH THE REST AND BUILD ZERO LENGTH TSB
  124. AT CTSBLWA
  125. #
  126. P<FTSBHDR> = TSBFWA + BTSBL[0]; # PUT FREE FORMAT ON NEXT TSB #
  127. FBUSY[0] = FALSE; # FREE TSB #
  128. FNOTMOV[0] = FALSE; # ALL FREE TSB"S ARE MOVEABLE #
  129. FHDRRSV[0] = 0; # CLEAR RESERVED AREA #
  130. FIDENT[0] = 0; # CLEAR IDENT FIELD #
  131. FPTSBL[0] = BTSBL[0]; # PREVIOUS TSB SIZE #
  132. FTSBL[0] = CTSBLWA - LOC(FTSBHDR); # SIZE OF THIS TSB #
  133. TEMP = ( LOC(FTSBHDR) + TSBHDRL ) - TSBFWA; # TSB WORD INDEX #
  134. ZERO( LOC(TSBAREA[TEMP]) ,FTSBL[0]-TSBHDRL ); #CLEAR AREA #
  135. BIGFREE = FTSBL[0]; # SET INITIAL BIGGEST FREE TSB #
  136. FFFWA = LOC(FTSBHDR); # SET INITIAL FIRST FREE FIRST WORD ADDR. #
  137. P<BTSBHDR> = CTSBLWA; # BUILD FREE TSB OF ZERO LENGTH AT CTSBLWA#
  138. BBUSY[0] = FALSE; # FREE TSB #
  139. BNOTMOV[0] = FALSE; # MOVEABLE #
  140. BHDRRSV[0] = 0; # CLEAR RESERVED AREA #
  141. BIDENT[0] = 0; # CLEAR IDENT FIELD #
  142. BPTSBL[0] = FTSBL[0]; # SET SIZE OF PREVIOUS TSB #
  143. BTSBL[0] = 0; # SET ZERO LENGTH #
  144. RETURN;
  145. END TERM # TSBINIT #
cdc/nos2.source/nam5871/extinit.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator