home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / tmg / tmgc.s < prev    next >
Encoding:
Text File  |  1975-05-13  |  1.9 KB  |  72 lines

  1. / tmg tables and global definitions
  2.  
  3. / in addition to these definitions each routine
  4. / follows the convention
  5. / f = stack frame pointer during parse and translation
  6. / g = stack frame end during parse
  7. / i = interprested instruction counter during parse and translation
  8.  
  9. .globl tables
  10. .globl x,si,j,k,n,g1,env
  11. .globl ek,ek.fs,ep,ep.fs,fs
  12. .globl lptr,sptr,rptr
  13. .globl outb,outt,outw
  14. .globl stkt,stkb,stke
  15. .globl ktat,ktab
  16. .globl input,cfile,lfile,dfile,ofile
  17.  
  18. / parse stack frame layout
  19. / 0 is previous frame pointer
  20. / return address in (sp)
  21. x = 2.    /exit bit, nonzero at end of rule
  22. si = 4.    / save location for instruction counter
  23. j = 6.    / input cursor counts characters
  24. k = 8.    / ktable water mark, last use location relative to base
  25. n = 10.    /address of ignored character class
  26. env = 12.    / frame pointer for static environment
  27. g1 = 14.    / frame length during parse
  28.  
  29. /symbol table entry layout
  30. /word 0 is for customer
  31. lptr=2.    /index of next entry on tree to left
  32. rptr=4.    /index of next entry to right
  33. sptr=6.    /first character of string in this entry
  34.         /next char is in 7, etc
  35.  
  36. / translation frame layout
  37. / used as ek(f), ep(f), etc
  38. / x and si have same meaning as in parse stack frame
  39. / return address in (sp)
  40. ek = 0    / k environment, frame where bunlde address is in si
  41. ep = 6    / p environment, frame where si points to parameter list
  42. fs = 10    / frame size
  43. ek.fs = ek+fs    / k environment in next frame
  44. ep.fs = ep+fs    / p env in next frame
  45.  
  46. .data
  47.  
  48. tables = .     /marks break between routines and tables
  49.  
  50. outt = 64.    / output buffer top
  51. stkt = 800.    /stack top for (f), not for (sp)
  52. ktat = 1200.    / k table top
  53.  
  54.  
  55. input: -1    / stream number of input
  56. cfile: 1    / stream number of current output
  57. lfile: 1    / last current output
  58. dfile: 2    / diagnostic file
  59. ofile: 1    /output file
  60.  
  61.  
  62. outw: 0    / output write pointer, number of chars in buffer
  63. .bss
  64. outb: .=.+outt    /output buffer
  65.  
  66.  
  67.  
  68. ktab: . = .+ktat    / contains translation rules that have been bundled
  69.  
  70. stkb: . = .+stkt    / stack, (f) ponts into this
  71. stke = .    /stack end
  72.