The 6510 processor inside the C64 is not able to access more then 64KB (2^16 bytes) of memory. So the RAM and ROM areas of the C64 were organized in banks.

The following diagram shows the layout of these banks:

            +-----+
$0000-$7FFF |     |
            |     |                        +------------+
$8000-$9000 |     |                        |            |
            |     +-------------+          | ROM-MODULE |
$A000-$BFFF |     |  BASIC-ROM  |          |            |
            | RAM +-------------+          +------------+
$C000-$CFFF |     |                        
            |     +-------------+----------+
$D000-$DFFF |     | CHARSET-ROM | I/O AREA |
            |     +-------------+----------+
$E000-$FFFF |     | KERNAL-ROM  |
            +-----+-------------+

The banks can be switched by writing different values to address $01.

A game-module inserted into the C64 module slot blends it's rom into the ROM-MODULE area. The first bytes of such ROM-MODULEs contained a special signature which resulted in a redirection of cold and warm start calls :

(2 byte cold start address)(2 byte warm start address)CBM80
The cold start address points to the routine which is jumped to in case of a reset. The warm start address points to the routine which is jumped to in case of the user hitting the "Run/Stop Restore"-combination. This feature was also used from many non-ROM-games to prevent being cracked.

The I/O AREA contains the SID and VIC registers. (e.g. "$D020 (=53280) - background color" hence the well known "POKE 53280,0")

The BASIC-ROM contains instructions and data neccessary to be able to execute BASIC programs.

The CHARSET-ROM contains the data for the original C64 charset.

The KERNAL-ROM contains the C64 kernal code.

The RAM is spread over the entire address range but only accessible via BASIC in those parts, which are not covered by any other bank. So from BASIC the RAM accessible RAM areas are $0000-$9FFF and $C000-$CFFF ($C000 = 49152 hence the well-known "SYS 49152"). As $0000-$0800 is not available for basic programs and one $00 byte is needed for remembering the "no program available"-status the amount of available basic memory is:

$A000 (= 40960) minus $0800 (= 2048) minus 1 equals 38911 bytes.

.. and every C64 user knows that number.

Log in or register to write something here or to contact authors.