home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 4 / 004.d81 / p_p_s#7 < prev    next >
Text File  |  2022-08-26  |  3KB  |  156 lines

  1.     PEEKs, POKEs, & SYSes - Part 7
  2.    --------------------------------
  3.  
  4.           by: Joel Ellis Rea
  5.  
  6.  
  7. ======================================
  8. Location:  11      Hexadecimal:  $000B
  9. Official Label:  COUNT      Type:  RAM
  10. Useful BASIC Commands:  PEEK, POKE
  11.  
  12.  
  13.    This location serves two purposes.
  14.  
  15. It is used when BASIC is dissecting
  16.  
  17. a line you have just typed in.  After
  18.  
  19. hitting the RETURN key, BASIC tries
  20.  
  21. to make sense of the line you just en-
  22.  
  23. tered.  The line is copied to a place
  24.  
  25. in memory called the Input Buffer.
  26.  
  27. This buffer takes up 88 bytes starting
  28.  
  29. at 512 ($0200).  To keep track of just
  30.  
  31. where in the buffer it is,  BASIC puts
  32.  
  33. the low byte of the current location
  34.  
  35. within the buffer in COUNT.
  36.  
  37.    The second purpose occurs when BA-
  38.  
  39. SIC needs to access an array. The rou-
  40.  
  41. tine which processes arrays uses COUNT
  42.  
  43. to store the number of dimensions. For
  44.  
  45. example, suppose you execute:
  46.  
  47.  
  48.    X = AR(2,5,X+3,Y/2)
  49.  
  50.  
  51. As BASIC evaluates the array reference
  52.  
  53. of AR, it stores a 4 in COUNT, because
  54.  
  55. there are 4 dimensions (subscripts) in
  56.  
  57. AR.
  58.  
  59.  
  60. ======================================
  61. Location:  12      Hexadecimal:  $000C
  62. Official Label:  DIMFLG     Type:  RAM
  63. Useful BASIC commands:  PEEK, POKE
  64.  
  65.  
  66.    DIMFLG is used when an array is
  67.  
  68. created.  An array can be created in 2
  69.  
  70. ways:  by the DIM statement, or by de-
  71.  
  72. fault first reference.  If an array is
  73.  
  74. referenced without being DIMmed, the
  75.  
  76. size of each dimension defaults to 11
  77.  
  78. (ranging from 0 to 10).  The DIMFLG is
  79.  
  80. zero if an array is created without a
  81.  
  82. DIM statement, or non-zero if DIM was
  83.  
  84. used.
  85.  
  86.  
  87. ======================================
  88. Location:  13      Hexadecimal:  $000D
  89. Official Label:  VALTYP     Type:  RAM
  90. Useful BASIC commands:  PEEK, POKE
  91.  
  92.  
  93.    This is an important flag for BASIC
  94.  
  95. expression evaluations.  VALTYP=0 when
  96.  
  97. a referenced variable, constant or ex-
  98.  
  99. pression is numeric, or 255 ($FF) when
  100.  
  101. it is a character string.
  102.  
  103.  
  104. ======================================
  105. Location:  14      Hexadecimal:  $000E
  106. Official Label:  INTFLG     Type:  RAM
  107. Useful BASIC commands:  PEEK, POKE
  108.  
  109.  
  110.    Sometimes it is not enough to know
  111.  
  112. if a variable or expression is numeric
  113.  
  114. since there are two kinds of numerics:
  115.  
  116. real and integer.  INTFLG is set to 0
  117.  
  118. if it is real (floating-point), or 128
  119.  
  120. ($80) if it is an integer.
  121.  
  122.  
  123. ======================================
  124. Location:  15      Hexadecimal:  $000F
  125. Official Label:  GARBFL     Type:  RAM
  126. Useful BASIC commands:  PEEK, POKE
  127.  
  128.  
  129.    This flag is used by BASIC for 3
  130.  
  131. things:  it has something to do with
  132.  
  133. the scanning of DATA statements (but I
  134.  
  135. couldn't figure out what), it is used
  136.  
  137. by the LIST command to see if it is
  138.  
  139. currently LISTing between quotes (so
  140.  
  141. it won't print out cursor controls as
  142.  
  143. tokens), and it is used by the 'gar-
  144.  
  145. bage collection' routine (the routine
  146.  
  147. that throws-away old strings to make
  148.  
  149. room for new stuff) to see if a gar-
  150.  
  151. bage collect has already been done.
  152.  
  153.  
  154. --------- continued in PART 8 --------
  155.                X to exit
  156.