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

  1.       PEEK/POKE/SYS -- Part 2
  2.       ==== ==== ===    ==== =
  3. --------------------------------------
  4. Location:  1       Hexadecimal:  $0001
  5. Official Label:  R6510      Type:  I/O
  6. Useful BASIC commands:  PEEK, POKE
  7.  
  8.  
  9.    This is the Bi-Directional I/O port
  10.  
  11. of the 6510 processor itself.  Each of
  12.  
  13. the lower 6 bits (bits 0-5) represents
  14.  
  15. a line on the I/O port.  Bits 0-2 con-
  16.  
  17. trol how the RAM, ROM and I/O are laid
  18.  
  19. out in the 64's memory.  Bits 3-5 are
  20.  
  21. for the cassette interface.  Bits 0-2
  22.  
  23. are so important that they have their
  24.  
  25. own Official Labels!
  26.  
  27.  
  28.    Bit 0 (LORAM) generally controls
  29.  
  30. whether BASIC is present or not.  BAS-
  31.  
  32. IC resides in 8K of ROM from $A000 -
  33.  
  34. $BFFF.  Bit 1 (HIRAM) generally con-
  35.  
  36. trols whether the Kernal is present or
  37.  
  38. not.  The Kernal is the main system
  39.  
  40. program.  BASIC must have the Kernal
  41.  
  42. present in order to operate.  The Ker-
  43.  
  44. nal resides in 8K of ROM from $E000 -
  45.  
  46. $FFFF.  Bit 2 (CHAREN) controls wheth-
  47.  
  48. er the Character Generator ROM is a-
  49.  
  50. vailable to the 6510 or not.  This ROM
  51.  
  52. contains the bit patterns that make up
  53.  
  54. the normal text character set.  The
  55.  
  56. 6567 VIC-II does NOT use this switch
  57.  
  58. to determine if it can use the charac-
  59.  
  60. ter set, only the 6510 processor.  The
  61.  
  62. ROM, if switched in, appears (to the
  63.  
  64. 6510) at $D000 - $DFFF.  Since the I/O
  65.  
  66. chips normally appear in that area, no
  67.  
  68. I/O can be performed (including scan-
  69.  
  70. ning the keyboard!) while the ROM is
  71.  
  72. switched in.  Its purpose is to allow
  73.  
  74. the ROM character set to be copied to
  75.  
  76. RAM so that it can be modified.
  77.  
  78.  
  79.    Bit 3 is the Cassette Write Line.
  80.  
  81. Changing this bit causes the record
  82.  
  83. head of the Datasette to cycle (pro-
  84.  
  85. vided that the motor is on and that
  86.  
  87. PLAY/RECORD is pressed).  It is used
  88.  
  89. to write information to the tape.  Bit
  90.  
  91. 4, the only input line, is the Cas-
  92.  
  93. sette Switch Sense Line.  If (PEEK(1)
  94.  
  95. AND 16) = 16, the PLAY button is down.
  96.  
  97. Bit 5 is the Cassette Motor Control.
  98.  
  99. POKE 1, PEEK(1) AND 31 OR 32 turns the
  100.  
  101. motor OFF, and POKE 1, PEEK(1) AND 31
  102.  
  103. turns the motor ON.  Another I/O chip
  104.  
  105. is used to actually READ data from the
  106.  
  107. Datasette.
  108.  
  109.  
  110.    Back to LORAM (Bit 0), HIRAM (Bit
  111.  
  112. 1) and CHAREN (Bit 2).  Normally, all
  113.  
  114. three are set to 1.  This means that
  115.  
  116. any read (PEEK, for example) to a lo-
  117.  
  118. cation controlled by the switch will
  119.  
  120. return the value in ROM at that loca-
  121.  
  122. tion.  A write (POKE, for example) to
  123.  
  124. either the BASIC or Kernal memory area
  125.  
  126. ALWAYS affects only the RAM "under"
  127.  
  128. the ROM, but the data cannot then be
  129.  
  130. read until the RAM is 'switched' in
  131.  
  132. using the appropriate bit(s) of R6510.
  133.  
  134.  
  135.    Unless a copy of BASIC and/or the
  136.  
  137. Kernal have been POKEd or LOADed into
  138.  
  139. the RAM under the ROMs, changing LORAM
  140.  
  141. or HIRAM using the BASIC POKE state-
  142.  
  143. ment will "lock up" the 64.  It will
  144.  
  145. have to be powered off and then on a-
  146.  
  147. gain to recover.  (A RESET button pur-
  148.  
  149. chased from a third party manufacturer
  150.  
  151. can also be used.)
  152.  
  153.    Another use is to be able to make
  154.  
  155. changes in BASIC and/or the Kernal.
  156.  
  157. FOR I=40960 to 49151 : POKE I, PEEK(I)
  158.  : NEXT
  159.  
  160. will copy BASIC into the RAM 'under'
  161.  
  162. the BASIC ROM (it takes a few seconds)
  163.  
  164. so it can be modified.  If you then
  165.  
  166. POKE 1, PEEK(1) AND 254, the RAM copy
  167.  
  168. of BASIC will be used.  POKE 1, PEEK
  169.  
  170. (1) AND 254 OR 1 switches the ROM copy
  171.  
  172. back in.
  173.  
  174. --------------<continued>-------------
  175.               <x to exit>
  176.