Commodore 64 Screen Memory Location Register Address
This article provides a technical overview of the specific register address that controls the screen memory location on the Commodore 64. It details the function of the VIC-II video chip, identifies the exact hexadecimal and decimal memory addresses used for configuration, and explains how specific bits within this register dictate where the video matrix is stored in RAM.
The VIC-II Video Chip Architecture
The Commodore 64 relies on the MOS Technology VIC-II chip to generate its video output. This chip manages sprites, colors, and the text or graphics matrix displayed on the screen. To function correctly, the VIC-II needs to know where in the system’s RAM it should look for the screen data. This configuration is not hardcoded but is instead programmable via specific memory-mapped registers.
The Control Register Address
The specific register address that controls the screen memory location on the Commodore 64 is $D018 in hexadecimal notation. In decimal format, this corresponds to memory location 53272. This register is part of the VIC-II chip’s internal control space, which is mapped into the CPU’s memory address space.
Configuring Screen Memory
While $D018 handles multiple settings, bits 4 through 6 are specifically responsible for selecting the screen memory address. These three bits allow the programmer to choose one of eight possible locations for the screen matrix within the currently selected video bank. By default, when a Commodore 64 is powered on, these bits are set to point to address $0400, which is the standard location for the screen memory in the basic configuration.
Video Bank Selection
It is important to note that the $D018 register selects the screen location relative to a 16KB video bank. The specific 16KB bank itself is selected via the CIA-2 I/O port at address $DD00. Together, the CIA-2 port and the VIC-II register at $D018 provide the complete address mapping required for the system to render text and graphics correctly on the display.
Conclusion
Understanding the role of register $D018 is essential for low-level programming on the Commodore 64. Whether writing assembly code or manipulating memory directly via BASIC, knowing that address 53272 controls the screen memory location allows developers to customize video layouts, implement scrolling effects, and manage memory efficiently within the machine’s limited RAM architecture.