8008/SCELBI Applications

September 1976 SCELBI ad for software
        in Byte
A SCELBI Computer Consulting ad for 8008 and 8080 software printed in BYTE Magazine, September 1976

 Unless otherwise noted, source code can be assembled with the AS8 assembler .  Use the -octal and -markascii options when building.  I have a custom version of AS8 that changes output port numbering and adds support for the RST instruction that I used in getting most of these programs up and running.  Use the .hex files to run from my OS/X 8008/SCELBI emulator.  Use the .bin files to load into real hardware, using the bootloader described below.  Not all of these applications have been run on actual hardware and even if they have, depending upon your I/O devices you may have some work to do.  However, all of these programs have isolated the code fragments (drivers) required for serial I/O, so it is fairly easy to modify for your hardware.

SERIAL PORT ASSUMPTIONS

The serial drivers that I have been using, assume that the serial receive line is connected to the input port's most significant bit (bit 7) and the serial transmit line is connected to the output port's least significant bit (bit 0).  See this blog post for more information about connecting serial ports.
http://www.willegal.net/blog/?p=4459

BASIC

I have dedicated a separate page to SCELBAL, the only BASIC implementation for the 8008.

Bootloader

This small bootloader can be toggled into a SCELBI in about 10 minutes.  The data bytes in the ADDRESS:DATA field of the below table must be toggled into the SCELBI using the front panel.

2400 BAUD SERIAL BOOT LOADER

LABEL
ADDRESS:DATA
SOURCE CODE
COMMENT
INPUT 000:113 INP INPORT

001:240 NDA check start bit

002:160 000 000 JTS INPUT

005:026 010 LCI 8
TIMER 007:021 DCC 1 1/2 bit times

010:110 007 000 JFZ TIMER

013:036 010 LDI 8 grab 8 bits
DATAIN 015:113 INP INPORT get 1 bit

016:022 RAL move to carry

017:301 LAB fetch current byte

020:032 RAR shift in this bit

021:310 LBA save in B

022:026 003 LCI 3 delay 1 bit time
BITTMR 024:021 DCC

025:110 024 000 JFZ BITTMR

30:031 DCD 8 bits captured?

031:110 015 000 JFZ DATAIN no, continue

034:371 LMB store byte

035:060 INL increment pointer

036:110 000 000 JFZ INPUT wrap?

041:050 INH increment MSB

042:104 000 000 JMP INPUT continue


BAUD
LOCATION 006 VALUE
LOCATION 023 VALUE
2400
010
003
1200*
020
012
300*
113
062
110*
322
214
*Calculated, but not tested

 Summarized Boot Loader Instructions

  1. Toggle in boot strap program using the SCELBI front panel
  2. Set source of serial data to 2400 baud, 8 bits, no parity
  3. Use the SCELBI front panel to set H and L registers to start address of program
  4. Set PC to 0
  5. Push RUN button on front panel
  6. Send binary data from source, pattern of lights on the front panel should change while data is being loaded
  7. Interrupt  SCELBI front panel when data has been sent
  8. Decrement L register (memory address) using 8008 DCL instruction (assumes L is not zero, which would require decrementing both H and L)
  9. Using panel, verify last byte with 8008 LAM instruction - address, then data will appear on front panel as you step through the LAM instruction
  10. Set to starting PC address of program using front panel and the 8008 JMP instruction
  11. Step the processor several times to ensure the program is starting correctly, then press run button to run your downloaded program

A SCELBI Tape Reader Program

This is a modified version of the standard SCELBI Tape Driver that is included with MEA.  It is modified to make it smaller and easier to enter into your computer using a monitor or front panel.  The main modification is removal of the write driver and moving code around to keep it all together to make entering the it manually simpler.

The provided version loads into page 015 which does not interfere with MCMON.  Just jump to the beginning of the program and start your tape or audio input source.  SCELBI programs on tape contain their own starting address so there is no need to set up load addresses.  If possible, I recommend that any apps you load don't use the same page as the tape reader.  That way, if you need to reload your program or load a new program into memory, you will not have to re-enter the tape reader program, at least until you power off your computer.

I have been able to create AIF files on my Macintosh using my 8008/SCELBI emulator and load them directly from the audio output port into a real SCELBI.

NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
Tape Reader
130 Bytes
03
 013
N/A
015-000
015-202
015-000
N/A

MemTest - An 8008 Based Memory Test Program

This was ported to the 8008 from my 6502 memory test program by Mark Arnold.  I have made some modifications to his port, so any problems are solely my fault.  It has a second entry point at 0-120 that will set up the ending page based on what is in register A.  The program defaults to checking from starting at the next location after the end of the program (002-026) to 12k (057-377).  If you modify the program and make it larger, you should change the starting address.  It takes a little over 30 seconds to check 1K of memory, making it about 15 times slower than the 6502 version running on a 1MHz computer.

It contains a couple of enhancements over the 6502 version.
  1. It doesn't stop on error
  2. It reports a total number of errors (up to 255) every pass
After each pass of the test, "PASS XXX E XXX" is displayed on the terminal and the test will start over.  In keeping with the octal notation used on the 8008, all numbers are reported in octal.  The number after the PASS is the number of passes executed and the number after E is the total number of errors encountered since loading the memory test program.

The following is displayed if it detects an error.

test_number high_address low_address expected_data actual_data

Here is an example where all zeros test reads all ones.  The location 060-006 is past the end of the 12K of memory on the system that reported this error.
000 060 006 000 377

Download by right clicking on the file name.


NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
memtest8008
1K
not used
 016
2400
000-100
002-025
000-100
000-000

Starshooter - a SCELBI Game as published in Byte magazine

http://www.vintagecomputer.net/stars.cfm

This is a surprisingly difficult solitaire type game.  Try it and see.  I have ported the source to this game to make it  assemble using the AS8 assembler found here.  I have also shrunk it down a bit so it will fit in a 1K memory system.  Among the things I removed are the instructions, but you should be able to figure it out by reading the article (link above) or the original source listing.
Note that though this game was apparently written on a SCELBI, the author did not leave any  registers available for processing a bit banged serial port in the input and output calls.  My assumption is that he had some kind of UART interfaced to his SCELBI so that I/O could be as simple as reading or writing a byte from an I/O register in this UART.   Without available registers, it was impossible to control a bit banged type interface, without rewriting portions of the main StarShooter program.  So that is what I did.  Note that while it runs well in emulation, I still need to do some tweaking to I/O to make it work well on a real SCELBI connected to a PC running a terminal emulation program.  If you decide to fix it up, let me know.

Download by right clicking on the file name. Note that no separate line feed issued - terminal must automatically issue LF when CR is detected.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
STARSHOOTER
1K
005
 016
2400
000-060
003-264
000-100
003-300

shooting stars screen

PI Generation on the SCELBI  -Two 8008 Benchmarks by Egan Ford

Egan Ford has generated some benchmarks on some eight bit systems and sent me these programs that generates PI on the 8008.   He used an assembler called Macro Assembler AS V1.42.

The first runs in 1K and generates PI to 100 places.    It takes about 30 seconds.  Download by right clicking on the file name.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
PI
1K
N/A
 016
2400
000-050
003-370
000-100
000-000
The second runs in 4K and generates PI to 1000 places.    You have to wait about half an hour before output is generated.  This  program has only been run in emulation and expects a UART to be present on port 014 for output purposes.  It will need serial driver work in order to run on real hardware.  Download by right clicking on the file name.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
PI
4K
N/A
 016
N/A
000-000
017-332
000-100
TBD

1000 digits of pi

Concentric Circle Generation on the SCELBI  - by Mark Arnold

When I first built my SCELBI 8H, I only had 1K of memory and needed a program to demonstrate it's capabilities.  Mark Arnold obliged by coming up with this program that uses SCELBI's floating point package to generate concentric circles.

Download by right clicking on the file name.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
CONCIRC2
1K
N/A
 016
2400
000-000
003-200
000-254
003-300

Concentric Circle Generation

Mandelbrot Generation on the SCELBI  - by Mark Arnold

Mark outdid himself by using SCELBI's floating point package to generate Mandlebrot images with only 1K of memory.  It's slow, but it's very cool.  There are two versions.  The program stops after each image is generated.  Press the RUN button to continue onto the next pass.

Download by right clicking on the file name.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
MANDEL4
1K
N/A
 016
2400
000-000
003-301
000-100
003-310
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
MANDEL5
1K
N/A
 016
2400
000-000
003-320
000-100
003-330

Mandelbrog Generation by 8008
            (emulation)

SCELBI Calculator  - by Nat Wadsworth

Machine Language Programming
              Book

This 4 function floating point calculator was demonstrated by Nat Wadsworth and Robert Findley to potential investors in order to get funding for SCELBI Computer Consulting.  In 1974, calculators were expensive luxury items, so this sort of demo was enough to interest those investors.  The program was published in the book "Machine Language Programming for the '8008' and similar microcomputers". This scan of the book is on Cameron Cooper's scelbi.com site.

I have left the divide by zero error unimplemented, the computer will halt when you try it.  Jump to 001-000 to resume.  Also, multiply is indicated by the symbol "X", not "*".  Input parsing is rather primitive.  Type a space or = sign if the computer will not take your input.  There are some issues with rounding in this floating point package, which were later fixed by the time SCELBAL was released.

Download by right clicking on the file name.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
CALC
2K
05
 016
2400
001-000
007-375
001-000
000-000

calculator demo

Galaxy  - by Robert Findley

This is port of the classic "Star Trek" computer game to the 8008 and 8080.   Though most versions of this game are in BASIC, Bob ported it to 8008 and 8080 assembly and published it in the SCELBI book "SCELBI's GALAXY GAME FOR THE 8008/8080".  A scan of this book can be found on Cameron Cooper's scelbi.com website.

Download by right clicking on the file name.

Note that no separate line feed issued - terminal must automatically issue LF when CR is detected.

NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
CALC
4K
05
 016
110
000-000
017-271
000-040
017-300

Galaxy

Hangman  - by Nat Wadsworth and Robert Findley

This is a computer version of the classic "Hangman" which was written for  the 8008 and 8080.   It was published in the SCELBI book "SCELBI's FIRST BOOK OF COMPUTER GAMES FOR THE 8008/8080".  A scan of this book can be found on Cameron Cooper's scelbi.com website.  Two versions are available here.  The first has serial bit banged drivers and can be run from MCMON.

Download by right clicking on the file name.
.
NAME
MEMORY REQUIRED
IN PORT
OUT PORT
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
HANGMAN
4K
05
 016
2400
002-000
007-355
002-000
----

This second version is designed to work with the SCELBI/scopewriter combination

Download by right clicking on the file name.

NAME
MEMORY REQUIRED
IN PORT
OUT PORTS
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
HANGMAN
4K
04 & 014 (keyboard)
010,011,012,013 (scopewriter)
---
002-000
007-355
002-000
---

The third version is designed to work with the SCELBI/DG Video Card combination

Download by right clicking on the file name.

NAME
MEMORY REQUIRED
IN PORT
OUT PORTS
BAUD RATE
BEGIN ADDRESS
END ADDRESS
START ADDRESS
BOOTLOADER START
HANGMAN
4K
04 & 014 (keyboard)
017 (DG Video)
---
002-000
007-355
002-000
---



Hangman



Back to Mike's Hobby Home Page