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.
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.