Egghead.page Logo

Commodore 16 Memory Map Video and I/O Allocation Explained

This article examines the Commodore 16 memory map, detailing how the system’s 64KB address space is divided between RAM, ROM, and peripheral control. It specifically focuses on the allocation of the 16KB user RAM block for video buffering and the upper memory addresses reserved for the TED chip’s input and output registers. Readers will gain a clear understanding of the hexadecimal ranges used for screen memory and hardware control within the C16 architecture.

The Commodore 16 utilizes the MOS Technology 6502 microprocessor, which addresses a total of 64KB of memory space ranging from $0000 to $FFFF. Unlike its predecessor, the Commodore 64, the C16 is equipped with only 16KB of usable RAM. This RAM is mapped to the lowest portion of the memory map, occupying the address range from $0000 to $3FFF. Because the video hardware does not have dedicated video RAM separate from the main system memory, the screen display data must reside within this limited 16KB RAM block. This shared memory architecture requires careful management by the operating system and programmers to ensure that video buffers do not overlap with basic program storage or variables.

Video memory allocation on the Commodore 16 is handled dynamically through the TED (Text Editing Device) chip, specifically the 7360 model. The TED chip controls both video output and system I/O, consolidating functions that were split between multiple chips in other Commodore machines. The starting address for the screen memory is not fixed; instead, it is determined by the value stored in the TED register located at $FD15. This register allows the system to point the video display to any suitable location within the available RAM, typically keeping the screen data near the top of the RAM block to preserve lower memory for BASIC programs. Color information is also stored within the RAM area, utilizing specific bytes associated with the screen matrix to define foreground and background attributes for each character cell.

Input and Output operations are confined to the upper region of the memory map, primarily within the range of $FD00 to $FFFF. The core I/O registers for the TED chip are located between $FD00 and $FDFF. This block contains control registers for the keyboard matrix, cassette interface, and video timing parameters. By reading from and writing to these specific addresses, the CPU can scan key presses, manage tape storage, and alter video modes without needing external interface chips. The remaining upper memory from $FE00 to $FFFF is generally reserved for Kernal ROM and system vectors, ensuring that interrupt handlers and low-level system routines remain accessible regardless of the I/O configuration.

Understanding this memory layout is crucial for developers working with the Commodore 16 hardware. The strict separation between the 16KB RAM block used for video and logic, and the upper ROM and I/O space, defines the system’s performance characteristics. The consolidation of video and I/O control into the TED chip simplifies the hardware design but places a higher demand on the main RAM for display purposes. By mapping video buffers within the $0000 to $3FFF range and dedicating $FD00 to $FDFF for hardware registers, the Commodore 16 maintains a functional interface within its cost-reduced memory constraints.