Commodore 64 BASIC Program Start Memory Address
This article provides a definitive answer regarding the memory location where BASIC programs commence on the Commodore 64 computer. It outlines the specific decimal and hexadecimal values used by the system, explains the relationship between this address and the BASIC pointers, and offers context on why this knowledge is essential for machine language interfacing and memory management.
The Specific Memory Address
The start of the BASIC program area on the Commodore 64 is held at memory address 2049 in decimal notation. In hexadecimal notation, which is commonly used by programmers referencing memory maps, this address is written as $0801. When a user types a BASIC line and presses return, the tokenized data is stored beginning at this location in the Random Access Memory (RAM).
Understanding BASIC Pointers
The Commodore 64 keeps track of this starting location using two
memory pointers located at addresses 43 and 44 (decimal), or $002B and
$002C (hexadecimal). These pointers store the low byte and high byte of
the start address respectively. By default, they point to $01 and $08,
which combines to form $0801. Users can verify this by typing
PRINT PEEK(43)+PEEK(44)*256 into the command prompt, which
will return the value 2049.
Importance for Developers
Knowing this address is crucial for developers who wish to mix machine language code with BASIC. Since the BASIC area starts at $0801, machine language routines often reside either below this mark in the free RAM area or above the BASIC program end. Understanding where the program begins allows programmers to calculate available memory accurately and prevent their code from overwriting the BASIC program storage during execution.
Conclusion
The Commodore 64 remains an iconic system for learning computer architecture, and understanding its memory map is fundamental. The BASIC program area consistently begins at address 2049 ($0801) unless modified by specific memory manipulation commands. This fixed starting point ensures stability for standard BASIC operations while providing a known baseline for advanced system programming.