Commodore 128
From Free net encyclopedia
{{Infobox Computer |name = Commodore 128 |developer = Commodore Business Machines (CBM) |type = Home computer |photo = Image:Commodore 128.png |caption = Commodore 128 |first_release_date = January 1985 |processor = MOS Technology 8502 @ 2.048 or 1.023 MHz and a Zilog Z80 @ 4.096 MHz }} The Commodore 128 (C128, CBM 128, C=128) home/personal computer was Commodore Business Machines (CBM)'s last commercially released 8-bit machine. Introduced in January of 1985 at the CES in Las Vegas, it appeared three years after its predecessor, the bestselling C64.
Contents |
Technical overview
The C128 was a significantly expanded, and compatible, successor to the earlier C64, the new machine featuring 128 kB of RAM (externally expandable to 640 kB) and an 80-column RGB monitor output (driven by the 8563 VDC chip with 16 kB dedicated video RAM), as well as a redesigned case/keyboard with a numeric keypad. Instead of the 6510 CPU of the C64, the C128 incorporated a two-CPU design. The primary CPU, the 8502, was a slightly improved version of the 6510; its main addition was the ability to run at a 2 MHz clock rate (however, this required turning off the 40-column video output). The second CPU was a Zilog Z80 and had the only purpose of ensuring CP/M compatibility.
The C128 had three modes of operation: C128 Mode (native mode), which ran at 1 or 2 MHz with the 8502 CPU and had both 40- and 80-column text modes available; CP/M Mode, which used the Z80 second CPU in either 40- or 80-column text mode; and C64 Mode, which was very nearly 100% compatible with the earlier computer.
C128 Mode
While the C64's graphics and sound capabilities were generally considered excellent, the popular home computer was the subject of a number of perennial criticisms. The 40-column VIC-II video display, while excellent for gaming, was often considered inadequate for productivity applications such as word processing. The lack of a numeric keypad was also an issue with some office suite software. Furthermore, the 2.0 revision of Commodore BASIC that was incorporated into the C64 was quite limited, and lacked keywords to handle the system's graphical and sound capabilities; these features had to be accessed via cumbersome PEEK
and POKE
commands. Some programmers also criticized the lack of a hardware reset button. Finally, the C64's 1541 disk drive was almost universally condemned as slow and unreliable.
The designers of the C128 succeeded in rectifying most of these concerns. A new chip, the VDC, provided the C128 with an 80-column color RGB display. The new 8502 CPU was completely backward-compatible with the C64's 6510, but could run at double the speed if desired. A numeric keypad was added to the keyboard, as were various other keys. The C64's rudimentary BASIC 2.0 was replaced with the far more flexible and powerful BASIC 7.0, which included keywords designed specifically to take advantage of the machine's capabilities, and also incorporated a sprite editor and machine language monitor. The screen editor was further improved. A reset button was added to the system. Two new disk drives - the single-sided 1570 and double-sided 1571 - were introduced in conjunction with the C128, promising far faster transfer speeds via a new "burst mode". The C128 also had far more RAM than the C64, and a far higher proportion was available for BASIC programming, due to the new MMU bankswitching chip.
The C128's greater hardware capabilities, especially the increased RAM, screen display resolution, and serial bus speed, made it the preferred platform for running the GEOS graphical operating system.
CP/M Mode
The second of the C128's two CPUs was the Zilog Z80, which allowed the C128 to run CP/M; the machine came with CP/M 3.0, aka CP/M Plus (backward compatible with CP/M 2.2) and ADM31/3A terminal emulation. To make a large application software library instantly available at launch, the Commodore 128 CP/M and accompanying 1571 floppy disk drive was designed to run almost all Kaypro-specific CP/M software without modification.
Unfortunately, the C128 ran CP/M noticeably slower than most dedicated CP/M systems, as the Z80 processor ran at an effective speed of only 2 MHz (instead of the more common 4–6 MHz) and because it used CP/M 3.0, whose complexity made it inherently slower than the earlier, more widespread, CP/M 2.2 system. From the source code of the C128 CP/M implementation, it is clear that the engineers originally planned to make it possible to run CP/M in the "fast" mode as well, with the 40-column output turned off and the Z80 running at an effective 4 MHz; however this did not work on the released C128 hardware.
A possibly unique feature of the C128 among CP/M systems was that some of the low-level BIOS services were executed by the 8502 chip instead of the Z80. The latter transferred control to the 8502 after having placed the pertinent parameter values in designated memory locations. The Z80 then turned itself off, being awoken by the 8502 at completion of the BIOS routine, with status value(s) available in RAM for inspection.
C64 Mode
By incorporating the original C64 BASIC and KERNAL ROMs in their entirety (16 kB total), the C128 achieves almost 100% compatibility with C64 software. The C64 mode can be accessed in one of three ways:
- Hold down the Commodore logo key when booting the system
- Enter the
GO 64
command in BASIC 7.0 immediate mode - Boot with a C64 cartridge plugged in
Some of the few C64 programs that fail on a C128 run correctly when the CAPS LOCK
key is pressed down (or the ASCII/National key on international C128 models). This has to do with the larger built-in I/O port of the C128's CPU. Whereas the C64's CAPS LOCK
key was simply a mechanical latch for the left SHIFT
key, the corresponding key on the C128 can be read via the 8502's built-in I/O port. A few C64 programs are confused by this extra I/O bit; keeping the CAPS LOCK
key in the down position will force the I/O line low, matching the C64's configuration and resolving the issue.
A handful of C64 programs wrote to $D030 (53296), often as part of a loop initializing the VIC-II chip registers. This memory-mapped register, unused in the C64, operated as a selector for 2 MHz mode in the C128. Since it was not disabled in C64 mode, an inadvertent write could blank the 40-column display by putting the CPU into fast mode. Fortunately, very few programs suffered from this flaw. In July 1986, COMPUTE!'s Gazette published a type-in program that exploited this minor incompatibility, by using a raster interrupt to enable fast mode when the bottom of the visible screen was reached, and then disable it when screen rendering began again at the top. By using fast mode during the vertical blank period, standard video display was maintained while increasing overall execution speed by about 20%. [1] [2]
An easy way to tell the C128's C64 mode and a real C64 apart, typically used from within a running program, is to write a value different from 0xFF (255)
to memory address 0xD02F (53295)
, which is used to decode the extra keys of the C128 (the numerical keypad and some other keys). On the 64 this memory location will always contain the value 0xFF
no matter what was written to it, but on a C128 in 64 mode the value of the location—a memory-mapped register—can be changed. Thus, checking the location's value after writing to it will reveal the actual hardware platform.
RAM setup
To handle the relatively large amounts of installable RAM, tenfold the 8502's 64 kB address space, an on-board MMU chip performed continuous bank switching concurrently with general operation of the machine. While the MMU was designed to handle more than 128 kB, the chips that were actually produced and used in the C128 cannot do so; thus memory expansions beyond 128 kB, the so-called RAM Expansion Units, contained their own memory controller which would move blocks of memory between the main and expansion RAM.
128D; RGB graphics
Image:C128d.jpg The Commodore 128D was released in the summer of 1985; it was an updated version of the C128 with a detached keyboard and a 1571 disk drive in the same box as the main system unit, providing a sleeker, more professional-looking appearance, much like that of a desktop PC. In Europe the first C128Ds came in a plastic case with a side-mounted carrying handle and were technically exactly the same as a C128 with the 1571 disk drive. Additionally these models were equipped with a somewhat noisy cooling fan, leading to the model sometimes being referred to as the "128 Diesel". Later models of the C128D came in a metal case; among these were the Commodore 128DCR (CR = cost reduced). These later models had some minor improvements. The internal design was more integrated to save production costs, but also improved the thermal design, so that a fan was not needed anymore.
Inside, the C128D ROMs contained several bug fixes, and the 8563 VDC chip (in the C128DCR, the 8568) was equipped with the maximum capacity 64 kB of video RAM – four times that of the original C128. This permitted the C128D to do higher-resolution graphics with more colors in RGB mode, although very little software took advantage of this. With or without the extra RAM, the VDC's high-resolution graphics modes were inaccessible from the C128's BASIC. They could only be utilized through low-level PEEK
and POKE
commands (or their assembly language equivalents), or via third-party BASIC language extensions. The most popular such toolkit was Free Spirit Software's "BASIC 8", which added several high-resolution VDC graphics commands to CBM BASIC. BASIC 8 was available on disk or as a ROM chip for installation in the C128's internal Function ROM socket.
Market performance
The system architecture of the C128, which in case of a C128D with memory expansion included three CPUs, five types of RAM memory, three operating modes, two system speeds, two graphics chips and two completely different low-level floppy disk encoding schemes was positively baroque and not at all orthogonal. This high complexity was probably a factor in the limited success of the C128—but of course also much of the reason for the machine's popularity among long-time CBM users and 'hackers', who enjoyed the capability of full C64 compatibility in a computer which was also fully usable as a BBS terminal and general office application platform in 80-column mode running native or CP/M programs. Another selling point for this group of users was the full-featured business keyboard, which was the first 'real' keyboard of a CBM computer since the less flexible (and thence, less popular) CBM-II/B series.
Because the C128 would run virtually all C64 software, and because the next-generation, 16-bit, home computers, primarily the Commodore Amiga and Atari ST, were gaining ground, relatively little software for the C128's native mode appeared (probably on the order of 100–200 titles). While the C128 sold a total number of 4 million units between 1985 and 1989, its popularity paled in comparison to that of its predecessor. This has been blamed on the lack of native software and on Commodore's less-aggressive marketing. An additional explanation may be found in the fact that the C64 sold huge numbers to people primarily interested in computer games, which the more expensive C128 didn't add much value towards improving (with the exception of a few Infocom text adventures)—the C128 was certainly a better business machine than the C64, but not really a better gaming machine, and people who wanted business machines bought IBM PC clones almost exclusively by the time the C128 was released. The main reason that the C128 still sold fairly well was probably that it was also a much better machine for hobbyist programming than the C64.
Also, when the C128(D/DCR) was discontinued in 1989, it was reported to cost nearly as much to manufacture as the 16-bit Amiga 500, even though the C128D had to sell for several hundred dollars less to keep the Amiga's high-value marketing image intact.
C128 trivia
- Easter egg: Entering the command "
SYS 32800,123,45,6
" in native mode would reveal the 40-column screen shown below:
- The Commodore 128's BASIC V7, the programming language which came built-in with the computer, could be crashed or cause the computer to reboot by executing PRINT""+-[x] (where x is any integer), depending on the number entered for x.
- Entering the keywords QUIT or OFF will produce an "?UNIMPLEMENTED COMMAND ERROR".
Specifications
- CPUs:
- MOS Technology 8502 @ 1 or 2 MHz
- Zilog Z80 @ 4 MHz (effectively running at 2 MHz due to stopping half the time to allow VIC-II video chip access to system bus)
- RAM: 128 kB system RAM, 2 kB 4-bit dedicated color RAM (for the VIC-II E), 16 kB or 64 kB dedicated video RAM (for the VDC), up to 512 kB REU expansion RAM
- ROM: 72 kB (28 kB BASIC 7.0, 4 kB MLM, 8 kB C128 KERNAL, 4 kB screen editor, 4 kB Z80 BIOS, ca. 9 kB C64 BASIC 2.0, ca. 7 kB C64 KERNAL, 4 kB C64 (or international) character generator, 4 kB C128 (or national) character generator) – expandable by 32 kB Internal Function ROM (optional; for placement in motherboard socket)
- Video:
- MOS 8564/8566 VIC-II E (NTSC/PAL) for 40-column composite video (a TV set can be used instead of a monitor if desired)
- Direct register access through memory-mapped I/O
- Text mode: 40×25, 16 colors
- Graphics modes: 160×200, 320×200
- 8 hardware sprites
- 2 kB dedicated 4-bit color RAM, otherwise uses main memory as video RAM
- MOS 8563 VDC (or, in C128DCR, the 8568) for 80-column digital RGBI component video, compatible with IBM PC CGA monitors, monochrome display also possible on composite video monitors; usable with TV sets only when the set has SCART and/or baseband video-in sockets in addition to the antenna connector
- Indirect register access (address register, data register in mapped memory)
- Text mode: 80×25, 16 colors (not the same as those of the VIC-II)
- Graphics modes: 640×200, 640×400 (interlaced)
- No hardware sprites
- 16 kB dedicated video RAM (64 kB standard in 128D, 128 was upgradable to 64 kB), accessible to the CPU only in a doubly indirect method (address register, data register on VDC, which in turn are addressed through address register, data register in mapped memory)
- MOS 8564/8566 VIC-II E (NTSC/PAL) for 40-column composite video (a TV set can be used instead of a monitor if desired)
- Sound:
- MOS 8580 SID synthesizer chip
- 3 voices, ADSR controllable
- White noise channel
- Cost-reduced and noise-reduced version of C64's MOS 6581; some early C128s actually have 6581s
- MOS 8580 SID synthesizer chip
- I/O Ports:
- All the ports of C64 (q.v.) —100% compatible— plus the following:
- Higher speed possible on the serial bus
- Expansion port more flexibly programmable
- RGBI video output (DB9-connector, identical to IBM PC CGA connector, but with an added monochrome composite signal)
References
- Greenley, Larry, et.al. (1986). Commodore 128 Programmer's Reference Guide. Bantam Computer Books/Commodore Publications. ISBN 0-553-34378-5.
- Gerits, K.; Schieb, J.; Thrun, F. (1986). Commodore 128 Internals. 2nd ed. Grand Rapids, Michigan: Abacus Software, Inc. ISBN 0-9164439-42-9. Original German edition (1985), Düsseldorf, West Germany: DATA BECKER GmbH & Co. KG.
Image:CBM Logo.svg List of Commodore microcomputers |
MOS Technology 6502-based (8-bit): MOS/CBM KIM-1 |
PET/CBM |
CBM-II (aka B/P series) |
VIC-20/VC-20 |
C64 |
SX-64 |
C16 & 116 |
Plus/4 |
C128 M68K-based (16/32-bit): Amiga 1000 | Amiga 500 | Amiga 2000 | [[Amiga 500+]] | Amiga 2500 | Amiga 3000, UX, T | Amiga 600 | Amiga 1200 | Amiga 4000 |