The Commodore 128, also known as the C128, is the last 8-bit home computer that was commercially released by Commodore Business Machines (CBM). Introduced in January 1985 at the CES in Las Vegas, it appeared three years after its predecessor, the Commodore 64, the bestselling computer of the 1980s. Approximately 2.5 million C128s were sold during its four-year production run.

The C128 is a significantly expanded successor to the C64, with nearly full compatibility. It is housed in a redesigned case with an improved keyboard including a numeric keypad and function keys. Memory was enlarged to 128 KB of RAM in two 64 KB banks. A separate graphics chip provided 80-column color video output in addition to the original C64 modes. It also included a Zilog Z80 CPU which allows the C128 to run CP/M, as an alternative to the usual Commodore BASIC environment. The huge CP/M software library, coupled with the C64's software library, gave the C128 one of the broadest ranges of available software among its competitors.

The primary hardware designer of the C128 was Bil Herd, who had worked on the Plus/4. Other hardware engineers were Dave Haynie and Frank Palaia, while the IC design work was done by Dave DiOrio. The main Commodore system software was developed by Fred Bowen and Terry Ryan, while the CP/M subsystem was developed by Von Ertwine.

The C128 released in the United Kingdom on 25 July 1985.

Design

The C128's complex architecture includes four differently accessed kinds of RAM (128 KB main RAM, 16–64 KB VDC video RAM, 2 kNibbles VIC-II Color RAM, 2-KB floppy-drive RAM on C128Ds, 0, 128 or 512 KB REU RAM), two or three CPUs (main: 8502, Z80 for CP/M; the 128D also incorporates a 6502 in the disk drive), and two different video chips (VIC-IIe and VDC) for its various operational modes.

The C128 does not perform a system RAM test on power-up like previous Commodore machines. Instead of the single 6510 microprocessor of the C64, the C128 incorporates a two-CPU design. The primary CPU, the 8502, is a slightly improved version of the 6510, capable of being clocked at 2 MHz. The second CPU is a Zilog Z80 which is used to run CP/M software, as well as to initiate operating-mode selection at boot time.

The C128's keyboard includes four cursor keys, , , and keys and a numeric keypad. None of these were present on the C64 which had only two cursor keys, requiring the use of the key to move the cursor up or left. This alternate arrangement was retained on the 128, for use under C64 mode. The lack of a numeric keypad, , and on the C64 was an issue with some CP/M productivity software when used with the C64's Z80 cartridge. A keypad was requested by many C64 owners who spent long hours entering machine language type-in programs. Many of the added keys matched counterparts present on the IBM PC's keyboard and made the new computer more attractive to business software developers.: "...they make the C128 more attractive to those established business software developers who are used to working with more traditional keyboard arrangements." While the 128's 40-column mode closely duplicates that of the C64, an extra 1K of color RAM is made available to the programmer, as it is multiplexed through memory address 1.

The design of the C128's power supply is different from that used with the C64. Although it is much larger, the new power supply is equipped with cooling vents and a replaceable fuse.

Early versions of the C128 occasionally experience temperature-related reliability issues due to the use of an RF shield over the main circuit board. The shield was equipped with fingers that contacted the tops of the major chips, ostensibly causing the shield to act as a large heat sink. A combination of poor contact between the shield and the chips, the inherently limited heat conductivity of plastic chip packages, as well as the relatively poor thermal conductivity of the shield itself, resulted in overheating and failure in some cases. The SID sound chip is particularly vulnerable in this respect. The most common remedy is to remove the shield, which Commodore had added late in development to comply with FCC radio-frequency regulations.

Modes

The C128 has three operating modes. C128 Mode (native mode) runs at 1 or 2 MHz with the 8502 CPU and has both 40- and 80-column text modes available. CP/M Mode uses both the Z80 and the 8502,Commodore CP/M Source code and programmers' manual. and is able to function in both 40- and 80-column text mode. C64 Mode is nearly 100 percent compatible with the earlier computer. Selection of these modes is implemented via the Z80 chip. The Z80 controls the bus on initial boot-up and checks to see if there is a CP/M disk in the drive, if there are any C64/C128 cartridges present, or if the Commodore key (which serves as the C64-mode selector) is being depressed on boot-up. Based on these conditions, it will switch to the appropriate mode of operation.

C128

In 1984, a year before the release of the Commodore 128, Commodore released the Plus/4. Although targeted at a low-end business market that could not afford the relatively high cost and training requirements of early IBM PC compatibles, it was perceived by the Commodore press as a follow-up to the 64 and would be expected to improve upon that model's capabilities. While the C64's graphics and sound capabilities were generally considered excellent, the response to the Plus/4 was one of disappointment. Upon the Plus/4's introduction, repeated recommendations were made in the Commodore press for a new computer called the "C-128" with increased RAM capacity, an 80-column display as was standard in business computers, a new BASIC programming language that made it easy for programmers to use the computer's graphics and sound without resorting to PEEK and POKEs, a new disk drive that improved upon the 1541's notoriously slow default transfer rate (without fastloader), as well as total C64 compatibility.

The designers of the C128 succeeded in addressing most of these concerns. A new chip, the VDC, provides the C128 with an 80-column color CGA-compatible display (also called RGBI for red-green-blue plus intensity). The then-new 8502 microprocessor is completely backward-compatible with the C64's 6510, but can run at double the speed if desired. The C64's Commodore BASIC 2.0 was replaced with BASIC 7.0, which includes structured programming commands from the Plus/4's BASIC 3.5, as well as keywords designed specifically to take advantage of the machine's capabilities. A sprite editor and machine language monitor were added. The screen-editor part of the Kernal was further improved to support an insert mode and other features accessed through ESC-key combinations, as well as a rudimentary windowing feature, and was relocated to a separate ROM. The VIC-II chip which controls the 40-column display can only operate at 1 MHz, so the 40-column display appears jumbled in FAST mode. In 80-column mode the editor takes advantage of VDC features to provide blinking and underlined text, activated through escape codes, in addition to the standard Commodore reverse text. The C128's 80-column mode can display lowercase characters along with PETSCII graphics characters; 40-column mode is subject to the same "upper- and lowercase" or "uppercase-plus-graphics" restriction as earlier Commodores. The 40- and 80-column modes are independent and both can be active at the same time. A programmer with both a composite and RGB display can use one of the screens as a "scratchpad" or for rudimentary multiple buffer support. The active display can be switched with . A hardware reset button was added to the system. The keyboard, however, was not switched to the Selectric layout as had become standard, instead retaining the same ADM-3A-derived design as on Commodore's prior models.

NTSC C128s will work with any CGA-type monitor (TTL RGB @ 15 kHz/60 Hz) such as the IBM 5153. However, PAL models of the C128 operate at 50 Hz and are not compatible with most CGA monitors, which expect a 60 Hz refresh rate.

Two new disk drives were introduced in conjunction with the C128: the short-lived single-sided 1570 and the double-sided 1571. A dual-disk 1572 model was announced but never produced. Later on, the 3.5-inch 1581 was introduced. The 1581 drive also has more on-board RAM than its predecessors, making it possible to open a larger number of files at one time. BASIC 7.0 includes DLOAD and DSAVE commands to support loading and saving to disk without using the ,8 or other device number, and also a DIRECTORY command that reads a disk's catalog information directly to screen memory without overwriting BASIC memory as in BASIC 2.0. In addition, the C128 introduces auto-booting of disk software, a feature standard on most personal computers, but absent from Commodore machines up to that point. Users no longer have to type LOAD"*",8,1. BASIC also added a COLLECT command for removing "splat" files (files that were not closed properly and truncated to zero length).

All 1571 drives will normally start up in native mode on the C128. If the user switches to C64 mode by typing GO 64, the drive remains in native mode. But if C64 mode is activated by holding the Commodore key down when powering up, the 1571 then goes into 1541 mode. This routine is necessary for software that performs low-level drive access.

The C128 has twice the RAM of the C64, a far higher proportion of which is available for BASIC programming, due to the new MMU bank-switching chip. This allows BASIC program code to be stored separately from variables, greatly enhancing the machine's ability to handle complex programs, speeding garbage collection and easing debugging for the programmer. An executing program can be STOPped, its code edited, variable values inspected or altered in direct mode, and program execution resumed with the variable table intact using BASIC's GOTO command. Although other BASICs support the CONT command to restart execution without clearing variables, editing any code causes them to be cleared. Different memory configurations can be loaded using BASIC's BANK command.

BASIC 7.0 has a full complement of graphics and sound-handling commands, as well as BASIC 4.0's disk commands and improved garbage cleanup, and support for structured programming via IF...THEN...ELSE, DO...WHILE, and WHILE...WEND loops.

On the downside, BASIC 7.0 ran considerably slower than BASIC 2.0 unless 2 MHz mode was used due to its 28 KB size (a 250% increase over BASIC 2.0) and having to bank switch to access program variables and BASIC program text (if greater than 16k in length).

The 128's ROM contains an easter egg: Entering the command SYS 32800,123,45,6 in native mode reveals a screen with a listing of the machine's main developers followed by the message Link arms, don't make them." Also, entering the keywords QUIT or OFF will produce an ?UNIMPLEMENTED COMMAND ERROR. These commands are holdovers from the BASIC interpreter intended for a planned but never-produced LCD portable computer and had been intended to exit from the BASIC interpreter and to ignore keyboard input during sensitive program execution, respectively.

The C128's greater hardware capabilities, especially the increased RAM, screen display resolution, and serial bus speed, made it a more capable platform than the C64 for running the GEOS graphical operating system.

CP/M