home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / SIMTEL / CPMUG / CPMUG031.ARK / TBASIC.D1 < prev    next >
Text File  |  1984-04-29  |  2KB  |  61 lines

  1.         INTERNAL FORMATS
  2.  
  3. Symbol Table Format:  ASCII, last character has bit 7 set=1.
  4.  
  5. Symbol Directory Format:
  6. Bytes 0&1 are pointer to location (0 if inactive dummy).
  7. Byte 2 bits have meanings as follows:
  8.   0-statement name    1-variable    2-function
  9.   3-channel name    4-array        5-unused
  10.   6-has been stored to    7-trace on
  11.  
  12. Numeric Array Format:
  13. bytes n,n+1 = back pointer
  14. bytes 2+n to n+x+1 = number of elements per dimension
  15. where n=(table pointer), and x=number of dimensions
  16. bytes 2+n+x to 1+n+x+(6*E) = number storage
  17. where E=total number of elements
  18. To locate an element within an array, location=base+offset,
  19. where base=2+n+x, and offset computed by:
  20.     N=1
  21.     OFFSET=S(N)
  22. LOOP    N=N+1
  23.     OFFSET=(OFFSET)(D(N))+S(N)
  24.     IF N<>LAST DIMENSION GOTO LOOP
  25.     OFFSET=OFFSET*6
  26.     END
  27. Where S is subscript, D cements in a dimension, () mean contents of.
  28. Example:  Array dimensioned 3,4,5; Get element 2,1,4.
  29.     N    Offset
  30.     1    2
  31.     2    2*4+1=9
  32.     3    9*5+4=49
  33.     3    49*6=294
  34.  
  35. String Locator:
  36.   bytes n,n+1=back pointer.
  37.   bytes n+2 to n+1+m=number of elements per dimension.
  38.   bytes m+n+2 to n+1+(2E)+m=string pointers.
  39.   Where m=number of dimensions, and E=number of elements.
  40.   2 Bytes per pointer, same organization as elements of
  41.   numeric arrays.  If (pointer)=0, string is (null).
  42.   Otherwise, points to first address of (string).
  43.  
  44. String Format:
  45.   bytes n,n+1=back pointer.
  46.   n+2 to n+1+m=ASCII data.
  47.   Where m=number of characters.  Last character as bit 7=1.
  48.   All other characters have bit 7=0.
  49.  
  50.  
  51.  
  52.  
  53.                 D-1
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.