Welcome to Elbug!

The year is 1982, I’m 13½ years old, and I had more or less completed the move from plain Lego bricks to Lego Tecnic. I’m also becoming increasingly interested in electronics, and while reading electronics books and magazines, and constructing my own circuits, Radio Luxemburg is playing on my AM radio. Reception is only possible after sunset and – depending on weather – even then is often quite poor, but the music and DJ’s are great, and I love it!

And this was when my computer career started: One of my father’s colleagues had built himself a simple computer based on the National Semiconductor SC/MP microprocessor. Based on a 1977 design by the Dutch/English Elektor magazine, he had chosen to skip their original printed circuit boards and instead build a compatible machine on wire wrap Eurocards. For some reason, he decided to give the machine to me 🙂

The machine was programmable in a tiny BASIC dialect called NIBL-E – and in machine code. Programs were recorded on cassette tape and loaded using a HEX I/O board with 16 hex number keys and 8 function keys for input, and 8 7-segment LED displays for output. A monitor program called Elbug residing in the lower 1.5 kb took care of hex i/o, cassette tape interface, and even had simple debugging tools. Starting the NIBL interpreter was easy though: You just had to RUN the program at address hex 1000, which was where the two 2 kb e-proms containing the full NIBL interpreter started.

The SC/MP had a very pretty instruction set architecture (almost RISC like), but was dreadfully inefficient and the BASIC programs executed very slowly. I therefore quite quickly moved on to learn the machine code language, writing programs on notepaper, converting the instructions to hex code by hand, and entering them on the hex-keyboard.

At some point, however, my father and I sat down and designed a simple assembler: Initially written in BASIC, over the following year or so, I wrote several machine code routines for it to speed up the assemblyprocess.

I remember carrying my open frame computer with several pc boards and 9 kb RAM and external terminal to a computer party. My friends found my computer odd, but cool. I programmed mine while they played games on their ZX Spectrums, ZX81s, andCommodore VIC-20s.

I explored and programmed the SC/MP computer for two or three years until I moved to a CP/M based personal computer, but that’s another story!

All this happened 30 years ago, and in the true spirit of retro computing, a few months ago, I started implementing an emulator in Java. Why? Well, I needed to get myself acquainted with a new Java IDE (IntelliJ), and my Java experience was getting pretty rusty… so why not do a hobby project which I could relate to? I still remember the hex codes of many SC/MP instructions – I think the memory of the computer is more or less hard-wired into my brain!

And here it is: My SC/MP emulator running the Elbug monitor:

My SC/MP emulator running the Elbug monitor

The processor emulator itself is about 600 lines of Java code, and there are some 500 additional lines of Java implementing a memory handling, a Swing based emulation of the HEX I/O board (including a 7 segment display widget), and a main program.

I feel I need to do some code clean up before I release it, but it’s my intention to put everything into a SourceForge project. Although I don’t know anyone apart from myself with a SC/MP computer, there are a few web pages around about this simple processor and the Elektor design, so it might be of interest to others.

I still have a few things to work out: The serial I/O on the SC/MP was implemented in software, so to run the original NIBL interpreter, I’ll have to do some cleaver de-serialization and serialization in Java as well as a simple terminal emulator. But I’ve got the software design pretty much worked out in my head, so I’m pretty sure I’ll make that work too.

I even have a plan to decode my old cassette tapes: A WAV file recording and some cleaver FFT analysis should be able to do the job of decoding the 600 baud FSK coding, I think.

By the way: The emulator is bug free! “That can’t be true!”, I hear you shout? Maybe not to you, but the thing is that none of the problems it has “bug me”: It’s all about entertainment! 😀

Advertisements

One thought on “Welcome to Elbug!

  1. It’s alive and now running NIBL-E – still having a few problems reading characters, I think. Terminal I/O is by a simulated UART, and the heuristics for detecting reading of bits isn’t quite robust enough yet.

    >PR “HEJ”
    HEJ

    >10 PR 10

    SNTX ERROR
    >LIST
    >print 10

    SNTX ERROR
    >pr 10

    SNTX ERROR
    >PR 10

    SNTX ERROR
    >PR 2HEJ          
    >PR “HEJ”
    HEJ

    >PR

    SNTX ERROR
    >

Skriv et svar

Please log in using one of these methods to post your comment:

WordPress.com Logo

Du kommenterer med din WordPress.com konto. Log Out / Skift )

Twitter picture

Du kommenterer med din Twitter konto. Log Out / Skift )

Facebook photo

Du kommenterer med din Facebook konto. Log Out / Skift )

Google+ photo

Du kommenterer med din Google+ konto. Log Out / Skift )

Connecting to %s