VIC-20 Memory Layout

Basic and Machine Language

Moderator: Moderators

Locked
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

VIC-20 Memory Layout

Post by Mike »

Just a quick reference chart for the VIC-20 memory layout I whipped up in a spare hour:

Code: Select all

               **** VIC-20 Memory Layout ****

         unexpanded    +3K RAM exp.   >=+8K RAM exp.

$0000 +----------------------------------------------+ $0000
      |             Zeropage ($00xx),                |
      |                Stack ($01xx),                |
      |         OS workspace ($0200..$03FF)          |
$0400 +--------------+--------------+----------------+ $0400
                     |              | RAMx (+3K RAM) |
$1000 +--------------+              +----------------+ $1000
      |              | BASIC memory |   screen RAM   |
      | BASIC memory |              +----------------+ $1200
      |              |              |                |
$1E00 +--------------+--------------+  BASIC memory  |
      |  screen RAM  |  screen RAM  |                |
$2000 +--------------+--------------+--            --+ $2000
                                    | BLK1 (+8K RAM) |
                                    +--            --+ $4000
                                    | BLK2 (+8K RAM) |
                                    +--            --+ $6000
                                    | BLK3 (+8K RAM) |
$8000 +-----------------------------+----------------+ $8000
      |               Character ROM                  |
$9000 +----------------------------------------------+ $9000
      |               VIC registers                  |
$9100 +----------------------------------------------+ $9100
      | $911x:VIA #1, $912x:VIA #2 registers+mirrors |
$9400 +-----------------------------+----------------+ $9400
      |      unused colour RAM      | for $1000 scrn |
$9600 +-----------------------------+----------------+ $9600
      | colour RAM for $1E00 screen |     unused     |
$9800 +-----------------------------+----------------+ $9800
      | $9800: I/O2, $9C00: I/O3 cartridge registers |
$A000 +-----------------------------+----------------+ $A000
                                    | BLK5 (+8K RAM) |
$C000 +-----------------------------+----------------+ $C000
      |                  BASIC ROM                   |
$E000 +----------------------------------------------+ $E000
      |                 KERNAL ROM                   |
$FFFF +----------------------------------------------+ $FFFF

Notes:

*Only* the internal RAM ($0000..$03FF, $1000..$1FFF) and the
character ROM ($8000..$8FFF) are accessible by the VIC chip!
It is not possible to have screen or character data at
$0400..$0FFF. The BASIC memory must be contiguous:

- RAM in BLK5 is not counted into "BYTES FREE".
- When there is RAM in BLK1, the screen RAM is moved to
  $1000 and any RAM expansion in $0400..$0FFF is blocked
  from BASIC use (i.e. BLK1 takes precedence over RAMx).

=> BASIC memory for  unexpanded VIC-20: $1001 .. $1DFF,
            ... for  +3K RAM expansion: $0401 .. $1DFF,
            ... for  +8K RAM expansion: $1201 .. $3FFF,
            ... for +16K RAM expansion: $1201 .. $5FFF,
            ... for +24K RAM expansion: $1201 .. $7FFF.

The byte before start of BASIC must always be set to 0!
Specifically with regard to the interaction of RAM expansions with graphics, I'd like to point people to the following postings: "RAM...what to get?" and "How to reinit 16k expansion?".

(mod: Please note the follow-up discussion has been split off into an own thread!)
Locked