tech.hss 6.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [Main]
  2. Title=Technical Information
  3. [Top]
  4. The actual symbol table entries (pointed to by the hash table,
  5. colliding entries are linked together) are stored in 8K chunks which
  6. are allocated as required. The first entry of each chunk is reserved
  7. as a link to the next chunk (or NULL in the last chunk) - this makes
  8. it easy to find all the chunks to free them when we're finished. All
  9. symbol table entries are stored in pass 1. During pass 2, cross-
  10. reference table entries are built in the same group of chunks,
  11. immediately following the last symbol table entry. Additional chunks
  12. will continue to be linked in if necessary.
  13. <BR><BR>
  14. Symbol names and macro text are stored in another series of linked
  15. chunks. These chunks consist of a link pointer followed by strings
  16. (terminated by nulls) laid end to end. Symbols are independent entries,
  17. linked from the corresponding symbol table entry. Macros are stored as
  18. consecutive strings, one per line - the end of the macro is indicated by
  19. an <CODE>ENDM</CODE> statement. If a macro spans two chunks, the last line in the
  20. original chunk is followed by a newline character to indicate that the
  21. macro is continued in the next chunk.
  22. <BR><BR>
  23. Relocation information is built during pass 2 in yet another
  24. series of linked chunks. If more than one chunk is needed to hold one
  25. section's relocation information, all additional chunks are released
  26. at the end of the section.
  27. <BR><BR>
  28. The secondary heap is built from both ends, and it grows and
  29. shrinks according to how many macros and <CODE>INCLUDE</CODE> files are currently
  30. open. At all times there will be at least one entry on the heap, for
  31. the original source code file. The expression parser also uses the
  32. secondary heap to store its working stacks - this space is freed as
  33. soon as an expression has been evaluated.
  34. <BR><BR>
  35. The bottom of the heap holds the names of the source code file
  36. and any macro or <CODE>INCLUDE</CODE> files that are currently open. The full path
  37. is given. A null string is stored for user macros. Macro arguments
  38. are stored by additional strings, one for each argument in the macro
  39. call line. All strings are stored in minimum space, similar to the
  40. labels and user macro text on the primary heap. File names are
  41. pointed to by the fixed table entries (see below) - macro arguments
  42. are accessed by stepping past the macro name to the desired argument,
  43. unless NARG would be exceeded.
  44. <BR><BR>
  45. The fixed portion of the heap is built down from the top. Each
  46. entry occupies 16 bytes. Enough information is stored to return to
  47. the proper position in the outer file once the current macro or
  48. <CODE>INCLUDE</CODE> file has been completely processed.
  49. <BR><BR>
  50. The diagram below illustrates the layout of the secondary heap.
  51. <PRE>
  52. Heap2 + maxheap2 -----------&gt;&nbsp;&nbsp;___________________________
  53. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
  54. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Input file table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
  55. struct InFCtl *InF ---------&gt;&nbsp;|___________________________|
  56. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
  57. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Parser operator stack&nbsp;&nbsp;&nbsp;|
  58. struct OpStack *Ops --------&gt;&nbsp;|___________________________|
  59. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
  60. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;(unused space)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
  61. struct TermStack *Term -----&gt;&nbsp;|___________________________|
  62. &nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Input file name stack&nbsp;&nbsp;&nbsp;|
  67. char *Heap2 ----------------&gt;&nbsp;|___________________________|
  68. </PRE>
  69. The "high-water mark" for <CODE>NextFNS</CODE> is stored in <CODE>char&nbsp;*High2</CODE>,
  70. and the "low-water mark" (to stretch a metaphor) for <CODE>InF</CODE> is stored
  71. in <CODE>struct&nbsp;InFCtl&nbsp;*LowInF</CODE>. These figures are used only to determine
  72. the maximum heap usage.