COSMAC Elf Turns 50

If you were interested in computers in the early 1970s, you struggled to get time on real computers since owning your own was all but impossible. In the middle of the decade, though, you could get a few computers: the Mark VIII, the Altair, the Apple I, and several others. Those were still pretty expensive, though. But in late 1976, an article in Popular Electronics said you could build a “powerful, expandable” computer for $80. The article in question was by [Joseph Weisbecker], who, unknown to most of us at the time, was actually the RCA employee behind the CPU — an RCA 1802. [Tech Time Traveler] takes a close look at the spunky little computer’s history in the video you can see below.

The 1802 was actually the second generation of the CPU, but the first that was all-in-one chip. [Weisbecker] started building the CPU as a personal project. He’d been a hacker even in high school, building relay-based tic-tac-toe games, among other things.

The first incarnation in his lab was “Fred,” with 100 TTL chips, and his idea was to have the computer be at least partially used as a video game — an interesting point, with Pong being very popular at the time.

The video covers a lot of history, but from a hacker’s point of view, the CPU was both amazing and limited. In a day when the 8080 and Z80 were kings, the 1802 had built-in DMA. This allowed a cheap companion video display that simply read bytes from memory and pushed them out to a TV.

Another neat feature was that the device had 16-bit registers and, even more interesting, 16 of them. On the one hand, any register could be, for example, the program counter or a memory index register. But on the other hand, there was no direct stack for doing calls and returns. The idea was that you’d use different registers for different subroutines, which was fine and efficient for very simple programs but not for the general case. One thing all 1802 programmers knew about was SCRT, the “standard call return technique” routines in the 1802 manual. But, as you might expect, this made calls and returns expensive.

There’s more that you’ll see in the video. People still build 1802-based computers and, of course, there are plenty of simulators, including ours. One thing you’ll notice is that the instruction set is very regular. Even if you didn’t know, you might guess that one guy designed the architecture.

28 thoughts on “COSMAC Elf Turns 50”

    1. Many CPUs use Jump-and-link to perform subroutine calls, and the RCA 1802 implements that via the SEP instruction (which switches the instruction pointer to one of the other 16, 16-bit registers, thus saving the return address in the program counter it came from).

      It’s still clumsy though. A subroutine call could be:

      LDI subroutine>>8
      PHI rx
      LDI subroutine&255
      PLO rx
      SEP x

      7b instead of 3 for a typical 8-bit CPU. Instead, a 1802 programmer would assign subroutine calls to one of the other registers (e.g. R10) then do:

      SEP 10 ;call
      DW subroutineAddr

      Call:
      LDA 0 ;PC was R0
      PHI r9 ;temp
      LDA 0 ;PC=ret addr now.
      PLO r9
      GLO r0
      DEC r11 ;SP
      STO r11
      GHI r0
      DEC r11
      STO r11 ;now PC has been saved.
      GLO r9
      PLO r0
      GHI r9
      PHI r0
      SEP 0 ;now jump to the subroutine proper.
      Call10: ;after the SEP 0, R10 points here.
      BR Call ;so just jump back.

      Similarly, you’d end up using another register for returns, e.g. R12, then do:
      SEP 12 ;return

      Ret:
      LDA r11
      PHI r0
      LDA r11
      PLO r0
      SEP 0 ;return
      Ret10: ;after the SEP 0 above, R12 points here.
      BR Ret ;so just jump back.

      Which is a bit shorter. Here, R11 is the SP. OK, so we’ve lost 2 registers simply to support call and return (with a stack), but the 1802 had 16x 16-bit registers to begin with. And it’s slow! However, on the 1802, it’s just as bad implementing threaded code, hence Forth implementations were common.

      https://www.atarimagazines.com/computeii/issue3/page52.php

    2. It definitely wasn’t designed to be compiler friendly, but then again early applications typically had 1K of RAM or less. Hand-crafted assembly code was the order of the day. It was simultaneously well ahead of its day and far behind too. The fastest instructions took 16 clock cycles and 32 was much more common. On the other hand, it was CMOS and could run off of a wall wart, so it had that going for it…

    3. Agree with the others–you got used to it. Using it with peripherals wasn’t difficult, while the speed wasn’t fast, you could clock it right down to zero for troubleshooting– in a crude way.

      1. As I told my daughter, ignorance can be cured but stupidity can’t.

        All youngsters are unavoidably ignorant. That doesn’t matter provided they recognise that and put in the effort required to learn.

        People who learn are a delight; people who don’t are a curse. Note that is age independent.

    1. +1

      IQ and common knowledge roughly peaked in the 90s, I’d say.
      That was last time when technology and social life were sort of in balance.
      By that time, information was available to a broad population, too.

      In the years before, say 1970s, the cultural levels wasn’t bad, either, of course.
      Hippies and lots of philosophical discussions and stuff.
      The Voyager probes and the golden records were made in that era, for example.

      But back then, someone had to be really into things and put an effort into learning.
      Shortwave radio and local libraries were sources of information, for example.

      By the 80s and 90s, youth lexica and educational construction kits were more common among the average young people, I’d say.
      Also, thanks to microcomputers, it was possible to read latest news.
      Beginning of the information age, so to say.

      In the 80s, RTTY on shortwave was a thing.
      News agencies transmitted their news regularily.
      Kids and young adults typed down listings published in computer magazines (BASIC or hex codes).

      By the 90s, even before www, various online services and Videotext already were a source of information, too.
      Making copies of written text on paper also nolonger was a luxury.

      1. In the 90’s such a small number of people owned computers, let alone internet connected ones, that it wasn’t a serious public information channel yet. It was a tiny bubble of mostly highly educated and well off individuals who mainly talked among themselves.

        If you were among these early adopters, it’s no surprise that the early 90’s would seem like a peak IQ moment, but that’s because it was such an exclusive club. After that, the “hoi polloi” was allowed to join the club in ever increasing numbers and the good old boys lost control: you were forced to interact with the rest of humanity and the average individual whose IQ was 10-20 points lower than your own.

        The effect became known as:

        https://en.wikipedia.org/wiki/Eternal_September

        1. In the 90s, there were cyber cafès and public libraries offering computer access to people who owned none. At least where I live.
          The fax machine also was widely used,
          so it was possible to request an excerpt of code or piece information as a fax transmission.

          After ca. 1993, when 32-Bit software became common, many older computers were sold off very cheap, if not discarded for free.
          In 1993, 16-Bit PCs such as 8088 or 80286 were available for very little money, because they couldn’t run latest software anymore.

          Older Windows 3.0 or DOS software still worked, so beginners could use them as introduction PCs, maybe upgrade them for little money.

          This UK site gives an idea: https://dosdays.co.uk/topics/1993.php
          Let’s note the “Cheapest/Clearance PCs”.

          The home computers were sold for little money at flea markets, too.
          Or yardsales/garage sales in some countries.
          Some were advertised in magazines (buy/sell/for free categories).
          Some relatives, acquaintance or family members “dumped” their old computer stuff in the kid’s bedroom, too.

          The C64 was still sold at a discount at this time, I think.
          The remaining warehouses were cleared.

          That being said, owning a PC wasn’t the point to me.
          I’m not into consumption, materialism and possesion that much.
          I simply think it was possible by that time period to access information more easily:
          It was about the rise of information society.

          Kids did read more books over the years, because books became common place and items of daily life (teens may or may not have different interests that age).
          There were all sorts of books, even some made for children and grandparents loved to gift them not seldomly.

          By contrast, someone in the 1960s was limited to news papers and AM radio.
          Books at home were less common in average household, some merely had a bible and a cooking book.
          Which I think was pretty backwards, because even my grandma had a small collection by then (such as Moomin book series and old fairytales).
          But a lack of books maybe also was normal for worker families, not sure.

          Anyway, whatever. Some kids in the 50s or 60s had to build their own crystal radio to listen to radio,
          because their home had none or the parents kept it under disclosure.
          Someone can argue if a black/white TV may or may not have been common in 1960s households, just as some can with with computers years later.
          Both were “expensive” or a luxury depending who to ask.

  1. I was 21 when the Elf project was published. Thanks to an older brother’s interest in electronics, and a sneaky father who had me complete his Cleveland Institute of Electronics snailmail correspondence course, I had been surrounded by electronics since I was 10. Finally a computer project I could afford! I wire wrapped the circuit on perfboard and struggled to understand machine language as I toggled in the two short programs that were examples in the Elf article in Popular Electronics. Something didn’t make sense. I finally had an epiphany when I walked through the program execution with pencil and paper. The descriptive captions to the programs had been reversed! That experience thought me that I knew almost nothing, but could learn most anything, so I always searched out people who knew more than I did and learned from them. Getting that deep in processor architecture helped me land a job building hardware and programming 8080 processors while learning assembly language and coding by hand. A few years later I joined a team as an 1802 hardware engineer that understood much of the software. We created the first solid state polyphase digital electric power/energy meter that came to market in the 80’s and 90’s. Thanks for highlighting the history at RCA.

    1. I didn’t mention it in the post, but my first technical writing was about the 1802 for QuestData (which, honestly, was more of a photocopied newsletter, but hey, they did pay me). That led to working for PC Techniques/Visual Developer, Dr. Dobb’s Journal, Web Techniques, articles in everything from Nuts & Volts, C/C++ User’s Journal, QST, 73, and many more. And, of course, to me writing for Hackaday. So yeah… big inflection point for me as well.

  2. The Altair, the HeNe Laser, and the Cosmic Elf were my favorite Popular Electronics covers of my childhood. I bought Robert Armstrong’s Cosmic Elf replikit and built it with my daughter when she was the same age. Lots of fun when the Enterprise appeared on the tiny CRT 🖖

    1. Beautiful orthogonal instruction set on the COSMAC 1802. The lack of that property in the Intel instruction sets baffled and repelled me. Still do.

      I know the hand model and photographer for the Nuts and Volts cover that featured his ELF 2K kit.

  3. I found it a nasty processor to work with (you can get used to anything if you need to). At the time (70s) one reason for using it was it was the only processor that you could buy that was radiation hardened.

  4. 1802 started my career and got me my first job in computers. I built my first computer from the Popular Electronics article. Took a sabbatical year from high scool and went to a job intervju with the computer under my arm. I got the job. It was the start of successful carreer. Now I’m 67 and still devevops software 2 days a week.
    I coded my 1802 computer using 8 flip switches and a push button stepping the dma read cycle. I still have this computer on a shelf in my home lab.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.