home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug066.arc / PSTACK.DOC < prev    next >
Text File  |  1979-12-31  |  1KB  |  50 lines

  1.  
  2.  
  3. The runtime stack is kept on the 8080 machine stack.
  4.  
  5. In all diagrams below, the highest memory address is at the T-O-P
  6. of the diagram.
  7.  
  8.         char        word        alfa (01234567)
  9.         ====        ====        ===============
  10.                         7
  11.                         6
  12.                         5
  13.                         4
  14.                         3
  15.                         2
  16.                 H        1
  17. pointer to ->    x        L        0
  18.  
  19.  
  20.         ____________________
  21.      -5 | return address   |
  22.      -4 |__________________|
  23.      -3 | dynamic link     |
  24.      -2 |__________________|
  25.      -1 | static link      |
  26. BR ->      0 |__________________|
  27.       1 | local variable 1 |
  28.       2 |                  |
  29.       . |                  |
  30.       . |                  |
  31.       . | local variable n |
  32.       n |__________________|
  33.         | function value   |    function return value
  34.     -10 |__________________|
  35.      -9 | parameter 1      |
  36.      -8 |__________________|
  37.      -7 | parameter 2      |
  38.      -6 |__________________|
  39.      -5 | return address   |
  40.      -4 |__________________|
  41.      -3 | dynamic link     |
  42.      -2 |__________________|
  43.      -1 | static link      |
  44. BR ->      0 |__________________|
  45.       1 | local variable 1 |
  46.       2 |__________________|
  47.         
  48.     ^^^ offsets from BR (base register)
  49.  
  50.