Introduction
The first two bytes of the file are the address in memory of the first data byte, as a 16-bit
number with the low byte first. 01 08 is $0801 (2049
decimal), the start of BASIC program memory; 00 C0 is $C000, the free
RAM block at 49152. The data is the rest of the file; the load address is not part of it and is
not stored in memory.
What LOAD does with it
LOAD "NAME",8(secondary address 0) ignores the stored address and loads the data at the start of BASIC memory,$0801. A machine-code program saved at another address is moved there, and probably does not work.LOAD "NAME",8,1(secondary address 1) loads the data at the stored address. This is how machine-code programs are meant to be loaded.- The load stops at the end of the file. The end address is the load address plus the data’s
length. The KERNAL leaves it in the pointer at
$AE–$AF, and after a BASICLOADBASIC takes it as the end of the program.
Where programs load
| Address | What is there on a C64 |
|---|---|
$0000–$00FF | Zero page: the processor port at $00 and $01, then variables of BASIC and the KERNAL. |
$0100–$01FF | The processor’s stack. |
$0200–$03FF | System variables, vectors (for example the IRQ vector at $0314) and the tape buffer. |
$0400–$07FF | The default screen memory, with the sprite pointers at the end ($07F8–$07FF). |
$0801 | The start of BASIC program memory, which runs up to $9FFF. |
$A000–$BFFF | The BASIC ROM, with RAM underneath it. |
$C000–$CFFF | Free RAM: a common place for machine-code programs loaded with ,8,1. |
$D000–$DFFF | The I/O area (VIC-II, SID, colour RAM, CIA chips), with RAM underneath it. |
$E000–$FFFF | The KERNAL ROM, with RAM underneath it. |
The explorer names the area of the load address. A file that loads under ROM or I/O is
normal for programs that switch the ROM out through the processor port at $01.
Where BASIC starts on other Commodore machines
The load address of a BASIC program is the start of BASIC memory of the machine it was saved on, and that differs. The explorer reads a chain of BASIC lines (as BASIC V2) at any of these addresses and says which machines it could be:
| Load address | Machine | Source |
|---|---|---|
$0801 | Commodore 64 | c64-wiki.com, Zeropage page: $2B/$2C “start of BASIC program text, default: 2049 / $0801” |
$0401 | PET / CBM; VIC-20 with a 3K expansion | pagetable.com “LOAD "$",8” (comments: PET BASIC begins at $0401; VIC-20 with 3 KB extension had it at $0401); techtinkering.com VIC-20 stub table |
$1001 | VIC-20 unexpanded; Commodore 16 / Plus/4 | techtinkering.com (“The Basic program starts at memory location $1001”, VIC-20); Plus/4 and C16: a C16 memory map (github.com/franckverrot/EmulationResources) gives $1000 as “Beginning of BASIC RAM”, and the program starting one byte above is our inference, backed by a forum post (lemon64, as summarised by a search tool) |
$1201 | VIC-20 with an 8K or larger expansion | pagetable.com comment (“more than 3 KB RAM extension, BASIC start was at $1201”); techtinkering.com stub table |
$1C01 | Commodore 128 | pagetable.com (“the C128 at 0x1C01”) |
The file never says which machine it was made on, so where two machines share an address the explorer names both. The fetched
pages were read through a summarising fetch tool (our words); several VIC-20 and PET statements come from reader comments, not
from Commodore’s own manuals. The C128 and Plus/4 use another start ($4001) in a graphics mode (same forum post): not recognised.
Only the BASIC V2 tokens are named: the other machines’ BASICs (PET BASIC 4, BASIC 3.5, BASIC 7) have more keywords, which show as {$xx}.
For these machines the C64’s named addresses are not used in the disassembly.
Data past the top of memory
The load address plus the data’s length must not pass $10000. The explorer
reports a file that does as having a problem.