home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 2
/
002.d81
/
p_p_s#2
< prev
next >
Wrap
Text File
|
2022-08-26
|
3KB
|
176 lines
PEEK/POKE/SYS -- Part 2
==== ==== === ==== =
--------------------------------------
Location: 1 Hexadecimal: $0001
Official Label: R6510 Type: I/O
Useful BASIC commands: PEEK, POKE
This is the Bi-Directional I/O port
of the 6510 processor itself. Each of
the lower 6 bits (bits 0-5) represents
a line on the I/O port. Bits 0-2 con-
trol how the RAM, ROM and I/O are laid
out in the 64's memory. Bits 3-5 are
for the cassette interface. Bits 0-2
are so important that they have their
own Official Labels!
Bit 0 (LORAM) generally controls
whether BASIC is present or not. BAS-
IC resides in 8K of ROM from $A000 -
$BFFF. Bit 1 (HIRAM) generally con-
trols whether the Kernal is present or
not. The Kernal is the main system
program. BASIC must have the Kernal
present in order to operate. The Ker-
nal resides in 8K of ROM from $E000 -
$FFFF. Bit 2 (CHAREN) controls wheth-
er the Character Generator ROM is a-
vailable to the 6510 or not. This ROM
contains the bit patterns that make up
the normal text character set. The
6567 VIC-II does NOT use this switch
to determine if it can use the charac-
ter set, only the 6510 processor. The
ROM, if switched in, appears (to the
6510) at $D000 - $DFFF. Since the I/O
chips normally appear in that area, no
I/O can be performed (including scan-
ning the keyboard!) while the ROM is
switched in. Its purpose is to allow
the ROM character set to be copied to
RAM so that it can be modified.
Bit 3 is the Cassette Write Line.
Changing this bit causes the record
head of the Datasette to cycle (pro-
vided that the motor is on and that
PLAY/RECORD is pressed). It is used
to write information to the tape. Bit
4, the only input line, is the Cas-
sette Switch Sense Line. If (PEEK(1)
AND 16) = 16, the PLAY button is down.
Bit 5 is the Cassette Motor Control.
POKE 1, PEEK(1) AND 31 OR 32 turns the
motor OFF, and POKE 1, PEEK(1) AND 31
turns the motor ON. Another I/O chip
is used to actually READ data from the
Datasette.
Back to LORAM (Bit 0), HIRAM (Bit
1) and CHAREN (Bit 2). Normally, all
three are set to 1. This means that
any read (PEEK, for example) to a lo-
cation controlled by the switch will
return the value in ROM at that loca-
tion. A write (POKE, for example) to
either the BASIC or Kernal memory area
ALWAYS affects only the RAM "under"
the ROM, but the data cannot then be
read until the RAM is 'switched' in
using the appropriate bit(s) of R6510.
Unless a copy of BASIC and/or the
Kernal have been POKEd or LOADed into
the RAM under the ROMs, changing LORAM
or HIRAM using the BASIC POKE state-
ment will "lock up" the 64. It will
have to be powered off and then on a-
gain to recover. (A RESET button pur-
chased from a third party manufacturer
can also be used.)
Another use is to be able to make
changes in BASIC and/or the Kernal.
FOR I=40960 to 49151 : POKE I, PEEK(I)
: NEXT
will copy BASIC into the RAM 'under'
the BASIC ROM (it takes a few seconds)
so it can be modified. If you then
POKE 1, PEEK(1) AND 254, the RAM copy
of BASIC will be used. POKE 1, PEEK
(1) AND 254 OR 1 switches the ROM copy
back in.
--------------<continued>-------------
<x to exit>