RCA 1802

Last updated
COSMAC
KL RCA 1802.jpg
RCA CDP 1802
General information
Launched1974
Physical specifications
Package(s)
History
Successor(s)CDP1804, CDP1805, CDP1806
RCA CDP1802 die shot RCA 1802 die.JPG
RCA CDP1802 die shot

The COSMAC (Complementary Symmetry Monolithic Array Computer) is an 8-bit microprocessor family introduced by RCA. It is historically notable as the first CMOS microprocessor. [1] The first production model was the two-chip CDP1801R and CDP1801U, which were later combined into the single-chip CDP1802. [2] The 1802 represented the majority of COSMAC production, and today the entire line is known simply as the RCA 1802.

Contents

The processor design traces its history to an experimental home computer designed by Joseph Weisbecker in the early 1970s, built at his home using TTL components. RCA began development of the CMOS version of the processor design in 1973, sampling it in 1974 with plans to move to a single-chip implementation immediately. Jerry Herzog led the design of the single-chip version, which sampled in 1975 and entered production in 1976. [3] [4]

In contrast to most designs of the era, which were fabricated using the NMOS process, the COSMAC was implemented in CMOS form and used static logic. This allowed it to run at lower power settings and even be stopped completely; in addition it would run cooler and not generate as much heat as NMOS chips. RCA also produced radiation hardened versions, which found use in the aerospace field. [5] These remain in production as of 2022, [5] and as of 2008 continued to be produced by Renesas (formerly Intersil). [6] [7]

Successors to the 1802 are the CDP1804, CDP1805, and CDP1806, which have an extended instruction set, other enhanced features (like on-chip RAM and ROM, and built-in timer), with some versions running at faster clock speeds, though not a significant speed difference. Some features are also lost, like the DMA auto-boot loader functionality. There are also some minor pin function changes, but the line continues to be produced in its original 40-pin dual in-line package (DIP) format.[ when? ]

History

FRED

Joseph Weisbecker had long been fascinated with the potential for computers in the home, having stated as early as 1955 that he expected they would one day be built into practically every device. The technology of the era made small embedded computers impossible, but the introduction of the integrated circuit (IC) in the 1960s changed things dramatically. In 1974 he described the possibilities in an IEEE Computer article:

For 20 years computer hardware has become increasingly complex, languages more devious, and operating systems less efficient. Now, microcomputers afford some of us the opportunity to return to simpler systems. Inexpensive…microcomputers could open up vast new markets. [8]

Beginning in 1970, [lower-alpha 1] Weisbecker began the design of a small machine using RCA transistor-transistor logic (TTL) ICs to construct the processor. Other parts, switches and lamps and such, he had to buy from Radio Shack, deliberately spreading his purchases around four stores so no one would ask him why he was buying so many parts. [9] The design was running in October 1971, containing 100 chips [1] spread over multiple circuit boards. [1]

The result, which he called FRED, ostensibly for Flexible Recreational Educational Device, was packaged into a box that was not unlike the Altair 8800 of a few years later, with toggle switches on the front panel for input, lamps for output, and later adding a hex pad keyboard. [9] Weisbecker added new features continually and by 1972 it had gained a character generator and the ability to load and save programs on cassette tapes. [1]

Weisbecker's daughter, Joyce Weisbecker, was immediately drawn to the system and began writing programs for it. This included several games, which were ported to later machines based on the COSMAC. When RCA entered the game console business in the later 1970s, these games were burned to ROM cartridge form, and Joyce became the first known female commercial videogame developer. [9]

Release

Weisbecker demonstrated the machine to RCA management throughout this period, but there was little interest at first. This was shortly after David Sarnoff had retired and handed the CEO role to his son, Robert Sarnoff. Robert was more interested in building the media side of the company while dating recording stars, ignoring RCA Laboratories in spite of a number of industry-leading developments taking place there. Some of the skepticism displayed by management may have had to do with the company's recent sale of their mainframe computer business to Sperry Rand with a huge writedown. [9]

Eventually, the company became interested in the system and began adapting it to their newly introduced COS/MOS fabrication system. A 1973 lab report [lower-alpha 2] refers to a "prototype" being delivered in 1972, but this is likely referring to the original TTL implementation. It goes on to note that an effort to reduce the processor to a two-chip implementation with deliveries in COS/MOS in 1974. It is here that the processor is first referred to as COSMAC, for COmplementary-Symmetry-Monolithic-Array Computer. It goes on to state that another lab will be producing the system in an 8-chip silicon-on-sapphire format, although the date is simply "soon after" the CMOS versions, and that plans for a single-chip version were already being planned. [10] [lower-alpha 3]

COSMAC devices

Although RCA began the development of the COSMAC in the early 1970s, it was some time before they introduced their own products based on it. In 1975, a prototype of an arcade game machine with swappable ROMs was experimented with for the coin-op business, but was ultimately abandoned. [9]

Meanwhile, Weisbecker had adapted the original FRED, known within RCA as System 00 by this time, using the new chipset to produce a greatly simplified single-board system known as then COSMAC ELF. Building instructions were described in an article in Popular Electronics magazine in 1976, and an expanded version with various upgrades in a second article in 1977. A unique feature of the ELF is that it did not require any read only memory (ROM) for startup, instead, the processor's direct memory access (DMA) system was used to read front-panel switches directly into memory. [9]

RCA debated whether to introduce pre-packaged versions of the ELF to the market. While they debated, further development led to a simplified machine combining the ELF with a new display driver chip, the CDP1861, to produce a game console. During this time, Joyce was hired by RCA to write several videogames for the platform, including a quiz-style educational product in partnership with Random House, one of the many companies that had been picked up by RCA's buying sprees. [9]

After a year of discussion, the company eventually decided to release two mass-market products based on the platform, a kit computer known as the COSMAC VIP, and a game console known as the RCA Studio II. The machines had been available since 1975, but the Studio II was announced only in January 1977, a couple of months after the Fairchild Channel F became the first cartridge-based machine on the market. Both would soon be eclipsed and largely forgotten due to the release of the Atari 2600 later that year. RCA canceled the Studio II in February 1978. [9]

RCA also released a series of modular computer systems, based on the RCA Microboard form factor from the 1802's initial release, up until the collapse of RCA itself. These were mainly aimed at industrial applications and systems development, and were highly configurable. [12]

Embedded use

The COSMAC was unique among early 8-bit processors in that it had been explicitly designed for microcomputer use; other designs of the era were invariably aimed at the embedded processor space, and those that had been designed for computer use were generally more complex systems, and often 16-bit. Although the COSMAC had been designed for computer use, RCA's slow market entry and undersupported attempts in this market ultimately failed and other processors like the MOS 6502 and Zilog Z80 would come to dominate this market. Ironically, COSMAC would ultimately find great success in the embedded market, because its CMOS design allowed it to work at lower power. By the late 1970s it was widely used in many industrial settings, and especially aerospace. Multiple 1802s were used as auxiliary IO processors in the Galileo probe to Jupiter in 1989, and it remains in use in similar roles to this day. [9]

Applications

Microcomputer systems

A number of early microcomputers were based on the 1802, including the COSMAC ELF (1976), Netronics ELF II, Quest SuperELF, COSMAC VIP, Comx-35, Finnish Telmac 1800, Telmac TMC-600 and Oscom Nano, Yugoslav Pecom 32 and 64, and the CyberVision 2001 systems sold through Montgomery Ward in the late 1970s, [13] as well as the RCA Studio II video game console (one of the first consoles to use bitmapped graphics). The Edukit single-board computer trainer system, similar to an expanded COSMAC Elf, was offered by Modus Systems Ltd. in Britain in the early 1980s. [14] Infinite Incorporated produced an 1802-based, S-100 bus expandable console computer trainer in the late 1970s called the UC1800, available assembled or in kit form. [15] [16]

As part of 1802 retrocomputing hobbyist work, other computers have been built more recently (post-2000), including the Membership Card microcomputer kit that fits in an Altoids tin [17] and the Spare Time Gizmos Elf 2000 (Elf 2K), [18] among others. See § Emulators and simulators for other systems.

Product integration

The 1802 was also used in scientific instruments and commercial products. [19] [20]

Post-1980 Chrysler and associated model vehicles use the 1802 in their second-generation Electronic Lean-Burn System, with electronic spark control, one of the first on-board auto computer-based control systems. [21] [22]

The 1802 was used in the manufacture of many pinball machines and video arcade games in Spain. [23]

Radiation hardening

A high-speed version of the 1802 was fabricated in Silicon on Sapphire (SOS) semiconductor process technology, which gives it a degree of resistance to radiation and electrostatic discharge (ESD). [24] A different radiation-hardened version of the 1802, developed jointly by RCA and Sandia National Laboratories, was built on bulk silicon using C2L (Closed COS/MOS Logic) technology. [25] [26] Along with its extreme low-power abilities, this makes the chip well-suited in space and military applications. [25] (Also, at the time the 1802 was introduced, very few, if any, other radiation-hardened microprocessors were available in the market).

Space technology and science

The 1802 was used in many spacecraft and space science programs, experiments, projects and modules such as the Galileo spacecraft, [27] Magellan, [28] the Plasma Wave Analyzer instrument on ESA's Ulysses spacecraft, various Earth-orbiting satellites [29] and satellites carrying amateur radio. [30]

The 1802 has also been verified from NASA source documentation to have been used in the Hubble Space Telescope. [31]

Military uses

A number of British military items from the 1980s and 1990s used the 1802, amongst them:

Programming languages

The first high-level language available for the 1802 was Forth, provided by Forth, Inc. and it was known as MicroFORTH, in 1976 (see Forth Inc's archive). Other available programming languages, both interpreters and compilers, are CHIP-8 (It was also invented by Joseph Weisbecker) (and variants), 8th (a version of Forth created by Lee Hart), [33] Tom Pittman's Tiny BASIC, [34] C, various Assemblers and cross-assemblers, and others. Other specialty languages were used by federal agencies such as NASA and its installations, including Johnson Space Center, AMES, Goddard, Langley, Marshall, and Jet Propulsion Laboratory (JPL), which included the HAL/S cross-compiler, [35] STOIC, a Forth-like language, [36] and others.

Interpreter for Process Structures (IPS), a programming language and development environment, was specifically written and used for real-time control of AMSAT satellites.

Emulators and simulators

The 1802 chip and computers using the microprocessor have been emulated and simulated in hardware and/or software by hobbyists. There are three designs in VHDL for an FPGA. [37] [38] [39] A bus-accurate, full speed COSMAC Elf clone was created without a CDP1802 microprocessor chip or CDP1861 video chip using PIC microcontrollers. [40] An online simulator of the COSMAC Elf (enhanced) written in JavaScript runs in the user's browser with no need to download. [41]

Description

Introduction

RCA CDP1802 COSMAC processor DIP chip pinout RCA CDP1802 COSMAC processor pinout.png
RCA CDP1802 COSMAC processor DIP chip pinout

The RCA 1802 has a static core CMOS design with no minimum clock frequency, so that it can be run at very low speeds and low power, including a clock frequency of zero to suspend the microprocessor without affecting its operation.

It has two separate 8-pin buses: an 8-bit bidirectional data bus and a time-multiplexed address bus, with the high-order and low-order 8-bits of the 16-bit address being accessed on alternate clock cycles. This contrasts with most designs of the era, like the MOS 6502 and Intel 8080, which used a 16-bit address bus.

The 1802 has a single bit, programmable and testable output port (Q), and four input pins that are directly tested by branch instructions (EF1-EF4). These pins allow simple input/output (I/O) tasks to be handled directly and easily programmed.

Because the instructions took 16 or 24 clock cycles to complete, the 1802 was not particularly fast. For comparison, the 6502 completes most instruction in 2 to 4 clock cycles, with the longest (official instruction) [42] taking 7 cycles. [43]

Part number suffix designations

Various suffixes to the CDP1802 part number denote technical specifications, including (A, B, & C) operating speed (3.2 MHz to 6.4 MHz), temperature (-40 °C to +85 °C, -55 °C to +125 °C), and voltage ranges (4V to 10.5V), package type (D, E, Q), and burn-in (X). These were somewhat standardized between the various source suppliers, including RCA, Intersil, Harris, Hughes Aircraft, and Solid State Scientific (SSS). Hughes used the HCMP prefix, and SSS used the SCP (and possibly BCP) prefix, instead of CDP, and had additional suffixes that have not been documented as of yet. (examples: CDP1802A, CDP1802ACE, CDP1802BCD, HCMP1802AP, SCP1802D) [44]

SuffixPackage Type
EPDIP = Plastic Dual In-Line Package
DSBDIP = Side-Brazed Ceramic Dual In-Line Package
QPLCC = Plastic Leaded Chip Carrier
XBurn-in

Registers and I/O

Register model CDP1802.PNG
Register model

The 1802 is an 8-bit byte machine, with minimal support for 16-bit operations, except via 2-byte manipulation. The primary accumulator is the 8-bit 'D' register (Data register). The single bit carry flag is DF (Data Flag). Most operations use the D register, including arithmetic and logic functions, and memory referencing load and store instructions. Most 16-bit operations have to work on the lower byte and then the upper byte, via D, using the DF as carry and borrow as needed.

An important feature of the 1802 is a set of sixteen registers of 16 bits each, used primarily for addressing. Using the SEP instruction, you can select any of the 16 registers to be the program counter; using the SEX instruction, you can select any of the 16-bit registers to be the index register. [45] Register R0 has the special use of holding the memory address for the built-in DMA controller. Register R1 has the special use of being the program counter for the interrupt handler. [46]

There are instructions that allow the values in these registers to be set and read via D, separately working the upper and lower 8-bits at a time. There are also instructions to perform increment and decrement of the entire 16-bit value, and a few instructions perform automatic increment and decrement, like LDA (load advance) and STXD (store via X and decrement). 16-bit register and value comparisons would also need to use the D register as a go-between, using multiple instructions to perform the operations.

The processor has five special I/O lines. There is a single Q output that can be set with the SEQ instruction and reset with the REQ instruction. There are four external, single-bit flag inputs, EF1, EF2, EF3, and EF4, and there are eight dedicated branch instructions to conditionally branch based on the state of those input lines. There are seven Input and seven Output port instructions that utilize the RX register and D accumulator.

The EF and Q lines were typically used for multiple interfaces on 1802-based hobbyist computers because of the lines' favorable and easy handling. It was typical for the Q line to drive a status LED, a cassette interface, an RS-232 interface, and the speaker. This meant that the user could actually hear RS-232 and cassette data being transmitted (unless a volume control was implemented). Traditionally, the EF4 line is attached to the INPUT momentary pushbutton on the COSMAC Elf. Other systems might use one of the other lines.

There are some other special use registers and flags, some internal, and some usable programmatically: 4-bit N, P, X, and I; 8-bit T; and 1-bit IE. On the Internet, there is many versions of a Table of the 1802 Instructions, here is one link : https://www.atarimagazines.com/computeii/issue3/page52.php There is a number of Tables in the File area for logged in members of the 1802 online club for forum at https://groups.io/g/cosmacelf/files. Each Instruction is a single Byte, of 8 Bits. The 4 Bits to the Left, sometimes called High Order Hex Digit, are to do with the actual nature of the Instruction, and those 4 Bits are involved with the I Register. The 4 Bits to the Right, sometimes called Low Order Hex Digit, are to do with the working Register, where Data is taken from, or put into it, and those 4 Bits are involved with the N Register. When a Program is being done, the various stages of the work and the Processes, are stored temporarily in the Register pointed to by the N Register, like what happens, when long Multiplication, or long Division, is done on a piece of paper. Of course sometimes the Data is moved to and from the Ram Memory section, and different Branches of the Program are done, as needed, in the flow of time.

Branching

There are three types of unconditional and conditional branching in the 1802, Short and Long, and Skips.

Short branches are 2-byte instructions, and use 256-byte range, single byte address, page absolute addressing in the range 0 to 255 (hex FF). There is no relative branching. The short branch always jumps within the page that contains the address byte. [46]

Long branches use full 16-bit addressing to support the 64K memory address space, and are the only 3-byte instructions.

Skip instructions increment the PC by one for the unconditional Short Skip, or two for the Long Skips. Only the Long Skip has conditional branching.

Subroutine calls

The processor does not have standard subroutine CALL address and RET instructions, though they can be simulated. The 16-register design makes possible some interesting subroutine call and return mechanisms, though they are better suited to small programs than general purpose coding.

A few commonly used subroutines can be called quickly by keeping their address in one of the 16 registers; however, the called subroutine must know (hard coded) what the calling PC register is to perform the "return" instruction. The SEP instruction is used to call a subroutine pointed to by one of the 16-bit registers and another SEP to return to the caller (SEP stands for Set Program Counter, and selects which one of the 16 registers is to be used as the program counter from that point onward). Before a subroutine returns, it jumps to the location immediately preceding its entry point so that after the SEP "return" instruction returns control to the caller, the register will be pointing to the right value for next usage. (the processor always increments the PC after reference and usage (retrieving the next instruction to execute), so this technique works as noted)

An interesting variation of this scheme is to have two or more subroutines in a ring so that they are called in round robin order. On early hobbyist computers, tricks and techniques like this were commonly used in the horizontal refresh interrupt to reprogram the scan line address to repeat each scan line four times for the video controller.

One well-known and often-used routine is known as SCRT (Standard CALL and RETURN Technique), which allows general purpose subroutine Call and Return, including passing of parameters "in line", and nested subroutines using a stack. Although any of the available registers can be used for this technique, per programmer's preference, many use the routine supplied by RCA in the CDP1802 User Manual, where the suggested register usage is R2 = Stack Pointer, R3 = General Program Counter (PC), R4 = Call, R5 = Return, R6 = Passed Arguments Pointer (non-destructive). Even though these supportive routines are small, there is an execution speed overhead using them. (as opposed to what would be incurred if actual CALL and RET instructions were part of the microprocessor's design) This setup allows R0 to be used for DMA and R1 to be used for Interrupts, if desired, allowing R7 through RF (hex) for general program usage.

Addressing modes

Because of the 16-bit address bus, and the 8-bit data bus, the sixteen general purpose registers are 16 bits wide, but the accumulator D-register is only 8 bits wide. The accumulator, therefore, tends to be a bottleneck. Transferring the contents of one register to another involves four instructions (one Get and one Put on the HI byte of the register, and a similar pair for the LO byte: GHI R1; PHI R2; GLO R1; PLO R2). Similarly, loading a new constant into a register (such as a new address for a subroutine jump, or the address of a data variable) also involves four instructions (two load immediate, LDI, instructions, one for each half of the constant, each one followed by a Put instruction to the register, PHI and PLO).

The two addressing modes Indirect register, and Indirect register with auto-increment are then fairly efficient, to perform 8-bit operations on the data in the accumulator. There are no other addressing modes, though. Thus, the direct addressing mode needs to be emulated using the four instructions mentioned earlier to load the address into a spare register; followed by an instruction to select that register as the index register; followed, finally, by the intended operation on the data variable that is pointed to by that address.

DMA and load mode

The CDP1802 has a simple built-in DMA controller, having two DMA request lines for DMA input and output. The CPU only accesses memory during certain cycles of the multi-step machine cycle, which required between 8 and 16 clock cycles. External hardware could read or write data during these periods without interrupting the processor, a general concept known as cycle stealing.

R0 is used as the DMA address pointer. The starting address of the DMA data would be put in R0 and then pulling the appropriate read or write pin on the CPU low. The CPU responded to the DMA request by incrementing the value in R0, so that the next request automatically stored in the next location in memory. Thus by simply repeatedly triggering the DMA pins, the system would walk through the entire memory.

The DMA controller also provides a special "load mode", which allows loading of memory while the CLEAR and WAIT inputs of the processor are active. This allows a program to be loaded without the need for a ROM-based bootstrap loader. This was used by the COSMAC Elf microcomputer and its successors to load a program from toggle switches or a hexadecimal keypad with no required software and minimal hardware. The user could simply set the switches to the next value, toggle the read, and then move on. There was no need to change the addresses, that was done automatically by the DMA stepping.

Instruction timing

Clock cycle efficiency is poor in comparison to most 8-bit microprocessors. Eight clock cycles makes up one machine cycle. Most instructions take two machine cycles (16 clock cycles) to execute; the remaining instructions take three machine cycles (24 clock cycles). By comparison, the MOS Technology 6502 takes two to seven clock cycles to execute an instruction, and the Intel 8080 takes four to 18 clock cycles.

RCA CDP 1802 instructions in Hexadecimal order
OpcodeInstructionMnemonicMachine Cycles
00It is idle, doing fetch cycles (I think)IDL2
0NLoad D from address in RNLDN N2
1NIncrement the 16 bit number in RNINC N2
2NDecrement the 16 bit number in RNDEC N2
30 MMBranch R(P) unconditionally to MMBR2
31 MMBranch R(P) to MM if Q is 1BQ2
32 MMBranch R(P) to MM if D is 00BZ2
33 MMBranch R(P) to MM if DF is 1BDF2
34 MMBranch R(P) if the External Flag EF1 is 1B12
35 MMBranch R(P) if the External Flag EF2 is 1B22
36 MMBranch R(P) if the External Flag EF3 is 1B32
37 MMBranch R(P) if the External Flag EF4 is 1B42
38Skip R(P) by 1 addressed memory byteSKP2
39 MMBranch R(P) to MM if Q is 0BNQ2
3A MMBranch R(P) to MM if D is NOT 00BNZ2
3B MMBranch R(P) to MM if DF is 0BNF2
3C MMBranch R(P) if the External Flag EF1 is 0BN12
3D MMBranch R(P) if the External Flag EF2 is 0BN22
3E MMBranch R(P) if the External Flag EF3 is 0BN32
3F MMBranch R(P) if the External Flag EF4 is 0BN42
4NLoad D from address in register RN and advance RN by 1LDA N2
5NStore D into memory pointed to by register RNSTR N2
60Increment the 16 bit number in R(X)IRX2
61Output from memory byte at R(X) to the BUS conditionOUT 12
62Output from memory byte at R(X) to the BUS conditionOUT 22
63Output from memory byte at R(X) to the BUS conditionOUT 32
64Output from memory byte at R(X) to the BUS conditionOUT 42
65Output from memory byte at R(X) to the BUS conditionOUT 52
66Output from memory byte at R(X) to the BUS conditionOUT 62
67Output from memory byte at R(X) to the BUS conditionOUT 72
68(Undefined for the RCA 1802)
69Input from the BUS condition to the memory byte at R(X) and the D register as wellINP 12
6AInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 22
6BInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 32
6CInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 42
6DInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 52
6EInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 62
6FInput from the BUS condition to the memory byte at R(X) and the D register as wellINP 72
70The memory byte at the address in R(x) is Returned to the memory byte at the address in R(P) after an Interrupt, and the Interrupt Enable register IE is enabled by setting to 1, R(X) is incrementedRET2
71The memory byte at the address in R(P) is moved into the memory byte at the address in R(X), Interrupt Enable register IE is Disabled by setting it to 0, R(X) is incrementedDIS2
72Load the memory byte at R(X) into the D register, increment R(X)LDXA2
73Store the D register into the memory byte at R(X) and decrement R(X)STXD2
74Add the memory byte at R(X) to the D register and the carry register DF, and the answer is moved to the D register and the carry register DFADC2
75Subtract the D register and the carry register DF from the memory byte at R(X), and move the answer to the D register and the carry register DFSDB2
76Shift the D register right and the carry register DFSHRC2
77Subtract the memory byte at R(X) from the D register and the carry register, and move the answer to the D register and the carry register DFSMB2
78Save the byte in register T into the memory byte at R(x)SAV2
79Save the 4 bit nibble in register X and the 4 bit nibble in register P into the byte in register T, the byte in register T is moved into the byte in register R(2), the nibble in X is moved into the nibble P, R(2) is decrementedMARK2
7AReset Q output to 0REQ2
7BSet Q output to 1SEQ2
7C KKAdd the byte KK to the D register with the carry register DF, move the answer to the D register and the carry register DF immediateADCI2
7D KKSubtract the byte in the D register and the carry register DF from the byte KK, and move the answer to the D register and the carry register DF, immediate 2SBDI2
7EShift the D register left and the carry register DFSHLC2
7F KKSubtract the byte KK from the D register and the carry register DF, move the answer to the D register and the carry register DF immediateSMBI2
8NMove the low byte of the RN register into the D registerGLO N2
9NMove high byte of the RN register into the D registerGHI N2
ANPut the byte in the D register into the low byte of the RN registerPLO N2
BNPut the byte in the D register into the high byte of the RN registerPHI N2
C0 MMMMLong branch R(P) to MMMM unconditionallyLBR3
C1 MMMMLong branch R(P) to MMMM if Q is 1LBQ3
C2 MMMMLong branch R(P) to MMMM if D is 00LBZ3
C3 MMMMLong branch R(P) to MMMM if DF is 1LBDF3
C4No operationNOP3
C5Long skip R(P) by 2 addressed memory bytes if Q is 0LSNQ3
C6Long skip R(P) by 2 addressed memory bytes if D is NOT 00LSNZ3
C7Long skip R(P) by 2 addressed memory bytes if DF is 0LSNF3
C8Long skip R(P) by 2 addressed memory bytesLSKP3
C9 MMMMLong branch R(P) to MMMM if Q is 0LBNQ3
CA MMMMLong branch R(P) to MMMM if D is NOT 00LBNZ3
CB MMMMLong branch R(P) to MMMM if DF is 0LBNF3
CCLong skip R(P) by 2 addressed memory bytes if the Interrupts Enabled IE is 1LSIE3
CDLong skip R(P) by 2 addressed memory bytes if Q is 1LSQ3
CELong skip R(P) by 2 addressed memory bytes if D is 00LSZ3
CFLong skip R(P) by 2 addressed memory bytes if DF is 1LSDF3
DNSet the nibble in the P register to point to the RN registerSEP N2
ENSet nibble in the X register to point to the RN registerSEX 02
F0Load the byte in the D register with the memory byte at R(X)LDX2
F1Logical OR the byte in the D register with the memory byte at R(X), move the result into the D registerOR2
F2Logical AND the byte in the D register with the memory byte at R(X), move the result into the D registerAND2
F3Exclusive OR the byte in the D register with the memory byte at R(X), move the result into the D registerXOR2
F4Add the byte in the D register to the memory byte at R(X), move the result into the D register2
F5Subtract the byte in the D register from the memory byte at R(X), move the result into the D registerSD2
F6Shift the D register right 2SHR2
F7Subtract memory byte at R(X) from the D register, move the result into the D registerSM2
F8 KKLoad KK into the D registerLDI2
F9 KKOR the byte in the D register with KK, move the answer into the D registerORI2
FA KKAND the byte in the D register with KK, move the answer into the D registerANI2
FB KKExclusive OR the byte in the D register with KK, move the answer into the D registerXRI2
FC KKAdd the byte in the D register with KK, move the answer into the D register and the carry register DFADI2
FD KKSubtract the byte in the D register from KK, move the answer into the D registerSDI2
FEShift the D register leftSHL2
FF KKSubtract the byte KK from the D register, move the answer to the D register and the carry register DFSMI byte2
Key to symbols in instruction table
RN/RX16 BIT GENERAL PURPOSE REGISTER (16 OF THESE LABELED R0 TO RF)
RN.0LOW-ORDER REGISTER NUMBER
RN.1HIGH-ORDER REGISTER NUMBER
MN/MXMEMORY BYTE LOCATION ADDRESSED BY CONTENTS OF RN/RX
P4-BIT PROGRAM COUNTER REGISTER
X4-BIT X REGISTER NUMBER
D8-BIT HOLDING REGISTER
DF1-BIT OVERFLOW REGISTER
IE1-BIT INTERRUPT ENABLE REGISTER
Q1-BIT OUTPUT REGISTER
T8-BIT SPECIAL REGISTER

Support chips

Graphics

In early 1802-based microcomputers, the companion graphics Video Display Controller chip, RCA CDP1861 (for the NTSC video format, CDP1864 variant for PAL), used the built-in DMA controller to display black and white bitmapped graphics on standard TV screens at up to 64 pixels horizontally by 128 pixels vertically. The 1861 was also known as the Pixie graphics system.

Although the faster versions of 1802 could operate at 45 MHz (at 5 V; it was faster (6.4 MHz) at 10 V), it was usually operated at 3.58 MHz, divided by 2 (1.79 MHz) to suit the requirements of the 1861 chip, which gave a speed of a little over 100,000 instructions per second, though some ran at other speeds such as the ~2.8 MHz of the Comx or 5 MHz of the Pecom. The COSMAC VIP, which integrated the video chip with the processor as a single purpose-built computer (rather than as an add-on to a hobbyist kit), notably ran the 1802 much slower, synchronising it exactly with the 1861 - at a non-standard 1.76064 MHz, as recommended in the Pixie's spec sheet reference design. [lower-alpha 4]

The CDP1862 Color Generator Circuit IC, an 1861 companion chip, could be used to generate color graphics. Some computer systems, like the Pecom 64 or the Telmac TMC-600, used the VIS (Video Interface System), consisting of the CDP1869 and CDP1870 companion ICs, for distinctly higher resolution color graphics, comparable to other 8-bit systems of the 1980s.

Code samples

This small code example tests the Event Flag (EF) pins. To test pins one through four, change B4 to B2, which tests EF2 pin.

LOOPB4EFbranch; because EF pins pins are active low this makes it behave as a not gateREQBRLOOPEFbranchSEQBRLOOP

This code snippet example is a diagnostic routine that tests ALU (Arithmetic and Logic Unit) Operations. [47]

..TESTALUOPS000090GHI0..SETUPR60001B6PHI60002F829LDIDOIT..FORINPUTOFOPCODE0004A6PLO60005E0SEX0..(X=0ALREADY)00066400OUT4,00..ANNOUNCEUSREADY0008E6SEX6..NOWX=600093F09BN4*..WAITFORIT000B6CINP4..OK,GETIT000C64OUT4..ANDECHOTODISPLAY000D370DB4*..WAITFORRELEASE000FF860LDI#60..NOWGETREADYFOR0011A6PLO6..FIRSTOPERAND0012E0SEX0..SAYSO00136401OUT4,0100153F15BN4*0017E6SEX6..TAKEITINANDECHO00186CINP4..(TO0060)001964OUT4..(ALSOINCREMENTR6)001A371AB4*001CE0SEX0..DITTOSECONDOPERAND001D6402OUT4,02001FE6SEX600203F20LOOP:BN4*..WAITFORIT00226CINP4..GETIT(NOTE:X=6)002364OUT4..ECHOIT00243724B4*..WAITFORRELEASE002626DEC6..BACKUPR6TO0060002726DEC6002846LDA6..GET1STOPERANDTOD0029C4DOIT:NOP..DOOPERATION002AC4NOP..(SPARE)002B26DEC6..BACKTO0060002C56STR6..OUTPUTRESULT002D64OUT4..(X=6STILL)002E7AREQ..TURNOFFQ002FCA0020LBNZLOOP..THENIFZERO,00327BSEQ..TURNITONAGAIN00333020BRLOOP..REPEATINANYCASE

Note: The above routine presumes that the CDP1802 microprocessor is in an initial reset state (or that it has been set as such prior to executing this code). Therefore, the program counter (PC) and the X indirect register 'pointer' are both set to 16-bit register R0. That is why you can output an immediate value, as in the example 'OUT 4,00', because PC and X are both pointing to R0. The PC is incremented after the opcode instruction byte is retrieved from memory, so it points to the next address when the OUT 4 is executed. Therefore, it outputs the value in memory pointed to by RX = R0, which is the next immediate byte. The OUT instruction also increments the X register, which is R0, which is also the PC, so it outputs the immediate value after the OUT and continues program execution at the next instruction address after the immediate value. This is why you see the routine set X (SEX) to register R6 and R0 as needed. Also note that, although the OUT opcode increments the RX register, to easily output a section of memory ('buffer'), INP does not. It stores the value at the address pointed to by RX and into the D 8-bit data byte accumulator, but RX is not modified.

The routine also presumes that OUT 4 will display the value in the CPU system's 8-bit LED or 2-digit hex display, and IN 4 gets the value from the eight toggle switches (or possibly the hex keypad). The BN4 opcode (loop; * = 'this address'), "branch if the single-bit input EF4 line is lo", is used to test if the momentary 'Input' pushbutton is pressed. The B4 opcode ('if hi') loop waits for the button to be released. SEQ and REQ turn the single Q line, which is usually attached to an LED, on and off.

The 1802 is a "byte machine", but has 16 16-bit registers, R0-RF (sometimes referred to as 0-F without the 'R' prefix). To deal with 16-bit register data, the programmer must Get and Put the Hi or Lo values of the registers using the D accumulator as the go-between. These high and low bytes of the registers are sometimes referred to as Rn.0 (lo) and Rn.1 (hi). Short Branches are 2-byte opcodes with page-absolute addressing, and a 256-byte address boundary. Long Branches are 3-byte opcodes with full 16-bit address branching.

This information should make the routine more understandable to any computer programmer who is knowledgeable enough to read "pseudo-code" and is minimally familiar with assembly and machine language programming.

Notes

  1. The exact date varies between references, as is the case for most dates related to the COSMAC. Edwards puts it in 1969, [9] while most others say 1970, the date used here.
  2. This was the annual review of 1973's operations, published some time in 1974. [10]
  3. The exact dates of the sampling and general release of the various COSMAC devices remain imprecise. Herb Johnson has produced an extensive list of RCA reports that form the basis of the dates in this article. [11]
  4. However, given the age of the machine, this may be due to the higher speed grades not having yet been developed, meaning the processor was only rated for a maximum of 3.2, or possibly even just 2.5 MHz. Although it is an extreme case, the machine wouldn't be alone in running a CPU well below its rated speed in order to save cost and complexity in the timing system, and simply running at 3.52 MHz would have represented a risky 10%, or even an unsustainably extreme 41% overclock.

Related Research Articles

<span class="mw-page-title-main">DEC Alpha</span> 64-bit RISC instruction set architecture

Alpha is a 64-bit reduced instruction set computer (RISC) instruction set architecture (ISA) developed by Digital Equipment Corporation (DEC). Alpha was designed to replace 32-bit VAX complex instruction set computers (CISC) and to be a highly competitive RISC processor for Unix workstations and similar markets.

<span class="mw-page-title-main">Intel 8086</span> 16-bit microprocessor

The 8086 is a 16-bit microprocessor chip designed by Intel between early 1976 and June 8, 1978, when it was released. The Intel 8088, released July 1, 1979, is a slightly modified chip with an external 8-bit data bus, and is notable as the processor used in the original IBM PC design.

<span class="mw-page-title-main">MOS Technology 6502</span> 8-bit microprocessor from 1975

The MOS Technology 6502 is an 8-bit microprocessor that was designed by a small team led by Chuck Peddle for MOS Technology. The design team had formerly worked at Motorola on the Motorola 6800 project; the 6502 is essentially a simplified, less expensive and faster version of that design.

<span class="mw-page-title-main">Zilog Z80</span> 8-bit microprocessor

The Z80 is an 8-bit microprocessor introduced by Zilog as the startup company's first product. The Z80 was conceived by Federico Faggin in late 1974 and developed by him and his 11 employees starting in early 1975, before going on sale in July 1976. The processor is a software-compatible with the Intel 8080 but with several enhancements and at a lower price. Like the 8080, the Z80 was mainly aimed at embedded systems, but it became one of the most widely used CPUs in home computers of the late 1970s and early 1980s. The Zilog Z80 was also common in military applications, musical equipment, and coin-operated arcade games of the era, including Pac-Man.

<span class="mw-page-title-main">MCS-51</span> Single chip microcontroller series by Intel

The Intel MCS-51 is a single chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems. The architect of the Intel MCS-51 instruction set was John H. Wharton. Intel's original versions were popular in the 1980s and early 1990s, and enhanced binary compatible derivatives remain popular today. It is a complex instruction set computer, but also has some of the features of RISC architectures, such as a large register set and register windows, and has separate memory spaces for program instructions and data.

<span class="mw-page-title-main">Intel 8008</span> 8-bit microprocessor

The Intel 8008 is an early 8-bit microprocessor capable of addressing 16 KB of memory, introduced in April 1972. The 8008 architecture was designed by Computer Terminal Corporation (CTC) and was implemented and manufactured by Intel. While the 8008 was originally designed for use in CTC's Datapoint 2200 programmable terminal, an agreement between CTC and Intel permitted Intel to market the chip to other customers after Seiko expressed an interest in using it for a calculator.

<span class="mw-page-title-main">Intel 8085</span> 8-bit microprocessor by Intel

The Intel 8085 ("eighty-eighty-five") is an 8-bit microprocessor produced by Intel and introduced in March 1976. It is the last 8-bit microprocessor developed by Intel.

<span class="mw-page-title-main">COSMAC VIP</span> 1977 microcomputer

The COSMAC VIP (1977) was an early microcomputer that was aimed at video games. Essentially, it was a COSMAC ELF with a supplementary CDP1861/CDP1864 video display chip. For a price of US$275, it could be purchased from RCA by mail order. It came in kit form, and had to be assembled. Its dimensions were 22 x 28 cm, and it had an RCA 1802 processor; along with a crystal clock operating at 1.76 MHz. It had 2 KB of RAM, which could be expanded to 4 KB on board, and 32 KB via an expansion slot. Its 5V DC CDP18S023 power supply had an output of 600 mA. I/O ports could be added to connect to sensors, interface relays, an ASCII keyboard, or a printer.

<span class="mw-page-title-main">COSMAC ELF</span>

The COSMAC Elf was an RCA 1802 microprocessor-based computer described in a series of construction articles in Popular Electronics magazine in 1976 and 1977. Through the back pages of electronics magazines, both Netronics and Quest Electronics offered low-priced, enhanced kits that were based on this design. The system was a very early single-board personal computer. It was operated without built-in ROMs and programs were entered directly with help of the CPU integrated DMA using 8 toggle switches and an Input push button.

<span class="mw-page-title-main">CHIP-8</span> Interpreted programming language

CHIP-8 is an interpreted programming language, developed by Joseph Weisbecker on his 1802 Microprocessor. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for these computers. The simplicity of CHIP-8, and its long history and popularity, has ensured that CHIP-8 emulators and programs are still being made to this day.

The TMS9900 was one of the first commercially available, single-chip 16-bit microprocessors. Introduced in June 1976, it implemented Texas Instruments' TI-990 minicomputer architecture in a single-chip format, and was initially used for low-end models of that lineup.

<span class="mw-page-title-main">Fairchild F8</span> 8-bit microprocessor first shipped in 1975

The Fairchild F8 is an 8-bit microprocessor system from Fairchild Semiconductor, announced in 1974 and shipped in 1975. The original processor family included four main 40-pin integrated circuits (ICs); the 3850 CPU which was the arithmetic logic unit, the 3851 Program Storage Unit (PSU) which contained 1 KB of program ROM and handled instruction decoding, and the optional 3852 Dynamic Memory Interface (DMI) or 3853 Static Memory Interface (SMI) to control additional RAM or ROM holding the user programs or data. The 3854 DMA was another optional system that added direct memory access into the RAM controlled by the 3852.

<span class="mw-page-title-main">Signetics 2650</span> 8-bit microprocessor

The Signetics 2650 was an 8-bit microprocessor introduced in July 1975. According to Adam Osborne's book An Introduction to Microprocessors Vol 2: Some Real Products, it was "the most minicomputer-like" of the microprocessors available at the time. A combination of missing features and odd memory access limited its appeal, and the system saw little use in the market.

<span class="mw-page-title-main">WDC 65C02</span> CMOS microprocessor in the 6502 family

The Western Design Center (WDC) 65C02 microprocessor is an enhanced CMOS version of the popular nMOS-based 8-bit MOS Technology 6502. It uses less power than the original 6502, fixes several problems, and adds new instructions. The power usage is on the order of 10 to 20 times less than the original 6502 running at the same speed; its reduced power consumption has made it useful in portable computer roles and industrial microcontroller systems. The 65C02 has also been used in some home computers, as well as in embedded applications, including medical-grade implanted devices.

<span class="mw-page-title-main">Intersil 6100</span> 12-bit microprocessor

The Intersil 6100 is a single-chip microprocessor implementation of the 12-bit PDP-8 instruction set, along with a range of peripheral support and memory ICs developed by Intersil in the mid-1970s. It was sometimes referred to as the CMOS-PDP8. Since it was also produced by Harris Corporation, it was also known as the Harris HM-6100. The Intersil 6100 was introduced in the second quarter of 1975, and the Harris version in 1976.

<span class="mw-page-title-main">WDC 65C816</span> 8/16-bit microprocessor

The W65C816S is a 16-bit microprocessor (MPU) developed and sold by the Western Design Center (WDC). Introduced in 1983, the W65C816S is an enhanced version of the WDC 65C02 8-bit MPU, itself a CMOS enhancement of the venerable MOS Technology 6502 NMOS MPU. The 65C816 is the CPU for the Apple IIGS and, in modified form, the Super Nintendo Entertainment System.

The RCA CDP1861 was an integrated circuit Video Display Controller, released by the Radio Corporation of America (RCA) in the mid-1970s as a support chip for the RCA 1802 microprocessor. The chip cost in 1977 amounted to less than US$20.

Joseph A. Weisbecker was an early microprocessor and microcomputer researcher, as well as a gifted writer and designer of toys and games. He was a recipient of the David Sarnoff award for outstanding technical achievement, recipient of IEEE Computer magazine's "Best Paper" award, as well as several RCA lab awards for his work.

The NEC μCOM series is a series of microprocessors and microcontrollers manufactured by NEC in the 1970s and 1980s. The initial entries in the series were custom-designed 4 and 16-bit designs, but later models in the series were mostly based on the Intel 8080 and Zilog Z80 8-bit designs, and later, the Intel 8086 16-bit design. Most of the line was replaced in 1984 by the NEC V20, an Intel 8088 clone.

The Mostek MK5065 was an 8-bit microprocessor introduced by Mostek in early 1974. The design was originally developed by Motorola for use in an Olivetti electronic calculator, and was licensed to Mostek for use in non-calculator roles. It featured three sets of processor registers, allowing it to switch to an interrupt handler in a single cycle, and a wait-for-data mode that aided direct memory access.

References

Citations

  1. 1 2 3 4 Cass 2018.
  2. "RCA COSMAC 1802". The Antique Chip Collector's Page. AntiqueTech.com. 21 April 2009. Archived from the original on 2 January 2013. Retrieved 27 December 2010.
  3. "Joseph Weisbecker". Vintage-Computer.com. 2010-02-08. Retrieved 2010-12-27.
  4. "Joseph A. Weisbecker (1932 - 1990)". CosmacElf.com. Retrieved 2010-12-27.
  5. 1 2 Cass, Stephen. "Chip Hall of Fame: RCA CDP 1802 - IEEE Spectrum". spectrum.ieee.org. IEEE. Retrieved 19 July 2023.
  6. "CDP1802A". Archived from the original on 2012-03-09. Retrieved 2010-08-23.
  7. "CDP1802AC/3 High-Reliability CMOS 8-Bit Microprocessor". Intersil Americas LLC. 17 October 2008.
  8. Weisbecker 1974, p. 41.
  9. 1 2 3 4 5 6 7 8 9 10 Edwards 2017.
  10. 1 2 Lab 1973, p. 152.
  11. Johnson, Herb (11 December 2018). "COSMAC 1801, 1802 "dates"".
  12. "RCA MCDS, Microboard Computer Development System". RetroTechnology.com. 2020-10-28. Retrieved 2022-05-08.
  13. Ruske, Dave. "Cybervision 2001, 3001, and 4001". COSMAC Elf. COSMACELF.COM. Retrieved 30 June 2016.
  14. "Wireless World magazine ad on page 22" (PDF). American Radio History. May 1981. Retrieved 21 Jan 2017.
  15. "Equipment Report - Infinite UC1800 Microcomputer" (PDF). ClassicCmp.org - Classic Computing. Radio Electronics Magazine. Aug 1977. Retrieved 22 Jan 2017.
  16. Haberhern, William (Feb 1977). "Kilobaud Magazine Article Pg 90". Archive.org. Wayne Green. Retrieved 22 Jan 2017.
  17. Hart, Lee. "The 1802 Membership Card Computer". Lee Hart's Homepage. Lee Hart. Retrieved 22 May 2016.
  18. "Spare Time Gizmos Elf 2000 (Elf 2K)".
  19. "Five generations of Sinar Moisture Meters" . Retrieved 22 May 2016.
  20. "Inforcel" . Retrieved 22 May 2016.
  21. Johnson, Herbert R. (22 June 2016). "RCA/Weisbecker "System 00" aka "FRED"". Retrotechnology. Retrieved 23 June 2016.
  22. "The Chrysler Lean Burn engine control system". All Mopar Chrysler Info. AllPar.com. Retrieved 23 June 2016.
  23. Donnelly, William (7 July 2016). "MDCCCII (1802) | Product Integration: Commercial & Scientific Applications". A COSMAC 1802 CPU RetroComputing Extravaganza. William Donnelly. Retrieved 7 July 2016.
  24. Briggs, G.R.; Connor, S.J; Sinniger, J.O; Stewart, R.G. (Aug 1978). "40-MHz CMOS-on-sapphire microprocessor". IEEE Transactions on Electron Devices. 25 (8): 952–959. doi:10.1109/T-ED.1978.19207.
  25. 1 2 Dingwall, A.; Stricker, R.; Sinniger, J. (October 1977). "A high speed bulk CMOS C2L microprocessor". IEEE Journal of Solid-State Circuits. 12 (5). IEEE: 457–462. doi:10.1109/ISSCC.1977.1155726.
  26. "A Radiation-Hardened Bulk Si-Gate CMOS Microprocessor Family" (PDF). IAEA.org. Retrieved 4 June 2016.>
  27. Tomayko, James (April 1987). "Computers in Spaceflight: The NASA Experience". NASA. Retrieved February 6, 2010.
  28. http://www2.jpl.nasa.gov/magellan/guide4.html#4.11 The Magellan Venus Explorer's Guide, Chapter 4 - The Magellan Spacecraft - Computing and Software
  29. "RCA COSMAC VIP". Obsolete Technology Website . Retrieved January 31, 2010.
  30. http://www.amsat.org/amsat-new/AboutAmsat/amsat_history.php AMSAT History
  31. Afshari, A. (January 1993). "Hubble Space Telescope's Wide Field/Planetary Camera" (PDF). Shutterbug. Archived from the original (PDF) on October 6, 2016.
  32. Royal Ordnance L1A1 fuze setter teardown , retrieved 2022-10-16
  33. "Membership Card Software".
  34. "Itty Bitty Computers & TinyBasic".
  35. "Current Status of the HAL/S Compiler on the Modcomp Classic 7870 Computer" (PDF).
  36. MASCOT (MIT Astronomical Spectrometer / Camera for Optical Telescopes). January 1980.
  37. Baker, Scott (2016). "1802 CPU coded in VHDL". Scott L Baker Github. Scott Baker. Retrieved 24 July 2016.
  38. Smith, Eric (2009). "cosmac - RCA COSMAC CDP1802 functional equivalent CPU core in VHDL". Eric Smith Github. Eric Smith. Retrieved 9 July 2019.
  39. Teal, Steve (2016). "VHDL 1802 Core with TinyBASIC for the Lattice MachXO2 Pico board". Steve Teal Github. Steve Teal. Retrieved 9 July 2019.
  40. Rossin, Ted (2011). "Elf Clone". Ted Rossin Homepage. Ted Rossin. Retrieved 24 July 2016.
  41. Donnelly, William (2011). "COSMAC Elf-ish CDP1802 Simulator in JavaScript". Donnelly-House Homepage. William Donnelly. Retrieved 24 July 2016.
  42. Landsteiner, mass:werk, Norbert (2021-06-05). "(Now Go Bang!) 6502 "Illegal" Opcodes Demystified". Now Go Bang! — mass:werk / Blog. Retrieved 2024-02-02.{{cite web}}: CS1 maint: multiple names: authors list (link)
  43. "6502 Instruction Set". mass:werk.
  44. Shvets, Gennadiy (2 Oct 2016). "RCA 1802 (CDP1802) microprocessor family". CPU-World. Gennadiy Shvets. Retrieved 17 October 2016.
  45. "What does SEX mean?" . Retrieved December 26, 2013.
  46. 1 2 User Manual for the CDP1802 COSMAC Microprocessor
  47. Pittman, Tom (1980). "A Short Course In Programming". cosmacelf.com. Retrieved 20 May 2017.

Bibliography

Minor parts of this article were originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL .