How Commodore Plus/4 Memory Bank Switching Works
The Commodore Plus/4 utilizes a specific memory management architecture controlled by its TED chip to manage the visibility of RAM and ROM within its 64KB address space. This article explains the technical mechanism behind memory configuration, detailing how the system switches between ROM and ROM-free RAM in upper memory blocks to maximize available program space. We will examine the role of the TED chip, the specific memory map segments, and the registers used to control these mappings.
The Commodore Plus/4 is built around the TED (Text Editing Device) chip, which integrates video display, audio, and memory management functions. Unlike the Commodore 64, which uses a dedicated CIA register for memory configuration, the Plus/4 handles memory mapping directly through the TED chip’s internal logic. The CPU addresses a standard 64KB space, but physical memory includes both RAM and multiple ROM cartridges containing the Kernal, BASIC, and the 3-plus-1 application suite. To provide users with maximum usable RAM for their own programs, the system must be able to hide these ROMs and expose the underlying RAM.
Memory bank switching on the Plus/4 is primarily concerned with the upper 32KB of the address space, from $8000 to $FFFF. In the default configuration, this area is occupied by the 3-plus-1 ROM, BASIC ROM, and the Kernal ROM. While the lower 32KB ($0000 to $7FFF) is typically dedicated to RAM and remains stable, the upper region is where the switching occurs. The TED chip allows specific sections of this upper memory to be toggled between ROM and RAM visibility. This process is essential for developers who need the full 60KB of free RAM that the Plus/4 is capable of providing when the built-in software is disabled.
The mechanism for controlling this switching involves specific registers within the TED chip’s I/O space. By writing specific values to these control registers, the system can disable the ROM overlays. When a ROM is disabled, the CPU no longer reads from the ROM chip at that address range and instead reads from the RAM located beneath it in the memory map. This is not a physical movement of data but a change in the electrical gating that determines which chip responds to the CPU’s address bus. This allows the Plus/4 to function either as a ready-to-run appliance with built-in software or as a development machine with a nearly contiguous block of RAM.
This memory configuration strategy differs significantly from later Commodore machines like the C128, which featured distinct 64KB memory banks that could be swapped entirely. On the Plus/4, the banking is more granular, focusing on specific segments of the upper memory map. The 3-plus-1 ROM occupies the segment from $8000 to $BFFF, while BASIC and the Kernal occupy the ranges above $C000. Each of these segments can be managed independently through the TED control logic. This granularity allows for flexible system configurations where a user might keep the Kernal active for I/O operations while switching out the BASIC and 3-plus-1 ROMs to free up space for machine code programs.
Understanding this switching mechanism is vital for programmers working with the Plus/4 hardware. Incorrect manipulation of the TED control registers can lead to system crashes, as disabling the Kernal ROM while executing Kernal code will cause the CPU to fetch invalid instructions from RAM. Therefore, memory bank switching routines must be carefully executed, often requiring the code to reside in the lower 32KB of RAM before disabling the ROMs in the upper region. This ensures that the processor continues to have access to valid executable code throughout the transition.
In summary, the Commodore Plus/4 handles memory bank switching through the integrated control features of the TED chip. By toggling the visibility of ROM overlays in the upper 32KB of the address space, the system exposes the underlying RAM for user applications. This architecture balances the convenience of built-in software with the flexibility required for serious programming, defining the Plus/4’s unique position in the Commodore 8-bit lineage.