KIM Uno: a DIY clone of the KIM-1

New features in 2020 firmware

The 2020 firmware contains some major extras

  • The KIM Uno is now compatible with both the KIM-1 and Apple-1. At the same time.

  • Do FF00 <go> and you'll be in WozMon. You still only have 1K RAM in your KIM-Apple-1. The real one has a full 4K (but is more expensive). Not enough RAM for Integer Basic alas!

  • Do FDDD <go> and you'll be in the Baum-Wozniak mini-assembler, published in 2020 for the Apple-1. It complements the KIM-1 programming style beautifully, now you don't need to memorise all the hex codes for instructions. A few keystrokes flip you between KIM-1 hex editing and the mini-assembler.

  • The 1K EEPROM in the Arduino can now be used as a cassette tape, through either the KIM-1 ROM or Apple-1 ACI ROM. So you can save your programming work on the road.

  • KIM-1 graphics games now work. The Farmer Brown game draws elephants and foxes on your segment LED display. 0200 <go> will show you.

  • The two original demo programs have been relocated to just above Farmer Brown:

    • the 0200 'First Program' is now at 02D0

    • the 0210 '6502 Programmable Calculator Demo' is now at 02E0

The KIM Uno firmware bumps hard into the size limits of the Arduino. There are only 12 bytes left in firmware space, and perhaps 20 in RAM. So this update looks like the final version, except for bug fixes.

Actually, I find it somehow satisfying that the KIM Uno emulates the bare minimalism of 1970s single board computers utilising absolutely everything on board of the bare minimum of today's hardware...

Apple-1 Compatibility

The Apple-1 ROMS (WozMon, Apple Cassette Interface and if you insist, Integer Basic too) are included. But the Basic is of no use with just 1K of RAM. The serial terminal has the Apple-1 KBD/DSP interface (40 columns etc) at the standard $D010-$D013 addresses, so Apple-1 programs will work fine (if they're small enough...)

The real reason for Apple-1 compatibility was to have the Baum-Wozniak mini-assembler. It is a miniature masterpiece crafted by Woz for the Apple II, based on the original Baum-Wozniak disassembler from 1975. It was only ported to the Apple-1 in 2020

 

It complements the KIM-1 programming style beautifully, as you don't need to memorise all the hex codes for instructions, just type assembly language like it's 1985. With a few keystrokes you can flip between KIM-1 hex editing and the mini-assembler. The relocate and moveit utilities help you move and insert code when needed.

An Apple-1 test drive

Enter FF00 <go> (<go> is Ctrl-G on the serial terminal!) to start the Apple-1's Wozmon.

Having the original Apple-1 manual at hand will be useful (link). Page 3 describes how to use Wozmon. There's quite a bit more to Wozmon (it is a user-friendly monitor after all), but the basics to get you going:

300: A9 00 AA 20 EF FF E8 8A 4C 02 03
                 -- Enters series of values starting in address 0300
300.30A          -- Display contents of memory from 0300 to 030A
0300R            -- run the program starting at 0x300
                    (character set will be printed, hit Ctrl-R)


You need some more Apple-1 knowledge, for instance you should not locate your program at 0x0200, as that is WozMon Workspace (it is where it stores its command line buffer). Anyway--


Entering a program from hand-assembled hex values is a step up from machines like the Altair (where you toggled in binary values using switches), but next-gen technology like an Apple-1 is quite powerful enough to assemble and disassemble for you.

For this, you can use the Baum/Wozniak mini-assembler. Originating from an amazing little disassembler that appeared in Dr. Dobb's in 1976, Mike Barry on the 6502 forum (nice thread) backported its later evolution, the mini-assembler down from the Apple II. The program made its first appearance on the Gigatron (link for story). Wozniak needed just 850 bytes of 6502 code for all the functionality shown below:

FDDDR            -- fire up the mini-assembler (Run from FDDD).
                    Instructions are printed on-screen.
300: LDA #$00    -- enter the same demo program at 0400
 TAX             -- note the leading space before add'l instructions
 JSR $FFEF
 INX
 TXA
 JMP $0302
300L             -- list the program just entered
<Return>         -- return to Wozmon
300R             -- run program
FDDDR            -- return to mini-assembler (to fix bugs & repeat)

<Ctrl-R>         -- reset back into the equally suave ROM of the KIM-1

If you've ever used a real Apple-1 (emulator), you'll appreciate the luxury of this built-in additional software! It took a long time to load something like this from tape. A manual is here (link).

 

Loading and saving to your terminal:

You can load and save from the terminal emulator using Wozmon's hex dump and hex display functions. Make sure your terminal emulator can insert a delay between each character it sends so the 6502 can keep up. TeraTerm is a good one.

 

To save:

- type 300.30B if that is the range you want to save;

- start capture on your terminal emulator;

- hit return and once all the data has scrolled by, close and save the captured file.

To load:

- just send the captured file, WozMon will 'type it in'.

Loading and saving to cassette tape:

The optional ACI (Apple Cassette Interface) is included in the KIM Uno. It uses the 1K EEPROM of the Arduino as a virtual cassette tape, and you can save up to 5 files on your 1K of tape space. In the old days, you would spool your cassette to an empty spot, note down the tape counter and start saving. It is now 2020, so this is what you do with today's 'solid state' tapes:

- store a tape counter number (a hex digit) in address $17F9

- the tape will instantly spool to that place on the tape

- and you're ready to start saving using the ACI.

The 256 byte ACI ROM is relocated from C100 to F100 to keep things  nice and compact on the KIM Uno. You should read the ACI manual (link), or at least this nice summary (link), but from WozMon:

F100R                - run the ACI ROM;

300.30BW         - W as in Write.

Reading is done the exact same way, replacing the W with the R for Read.

See the KIM-1 cassette tape functionality below for some other functions, like getting a directory of your tape; deleting files and initialising the tape. You do need to initialise the tape before you can do the above example of saving.
 

Important is that the Pro Mini has the two pins for A4 and A5 (green circle). A6 and A7 (red circle) are not used in the Uno firmware. They can be ignored altogether.

The original Apple-1. Why so many chips?

All it takes for an Apple-1 experience:

a $1.80 Arduino clone - you don't really even the KIM-1 keypad and LED display, just the Arduino's serial port is enough.

Tip: The Apple-1 only knows upper case. The KIM Uno will convert for you on-screen. But you must still use R, not r to run a program from WozMon. And L, not l to do an assembly listing. Make a habit of the Caps Lock when you're using the Apple-1.

What you see when entering assembly code

The optional Apple-1 ACI tape interface.

Sometimes it worked quite reliably...

How to use the Apple-1  (2020 firmware version only)

 

The 2020 firmware contains some major new features:

  • The KIM Uno is now compatible with both the KIM-1 and Apple-1. At the same time.
    FF00 <GO> to enter WozMon. FDDD <GO> (or FDDDR from Wozmon) to enter the Baum-Wozniak mini-assembler. It complements the KIM-1 programming style beautifully, now you don't need to memorise all the hex codes for instructions. A few keystrokes flip you between KIM-1 hex editing and the mini-assembler.

  • The 1K EEPROM in the Arduino can now be used as a cassette tape. So you can save your programming work on the road.

The main reason for Apple-1 compatibility was to run the Baum-Wozniak mini-assembler. It is a miniature masterpiece crafted by Woz for the Apple II, based on the original Baum-Wozniak disassembler from 1975. It was only ported to the Apple-1 in 2020 by Mike Barry (link).

It complements the KIM-1 style of programming beautifully, as you don't need to memorise all the hex codes for instructions. Just type in assembly language like it's 1985. With a few keystrokes you can flip between KIM-1 hex editing, the mini-assembler and WozMon. The relocate and moveit utilities help you move and insert code when needed - which is what the mini-assembler itself could not do...

The original Apple-1 could be expanded from 4K to 8K of RAM and then could load Integer Basic from tape. On the KIM Uno, you can plug in an Integer Basic ROM (as a compile option), but it is of no use with just 1K of RAM. Unless you are a real Apple-1 hacker who knows how to use Integer Basic subroutines to use for your own assembly programs... then you can do that on the KIM Uno too ;)

apple-1.png

Apple-1 Compatibility

The Apple-1 ROMS (WozMon and Apple Cassette Interface) are included and work fine. The Apple-1 KBD/DSP interface is at the standard $D010-$D013 addresses, and the behaviour (40 columns, the stuck 7th bit etc) is emulated. So Apple-1 programs will work fine as long as they fit in 1K.

An Apple-1 test drive

Enter FF00 <go> (remember, <go> is Ctrl-G on the KIM Uno serial port!) to start the Apple-1's Wozmon.

Having the original Apple-1 manual at hand will be useful (link), see Page 3. There's quite a bit more to Wozmon (it is a user-friendly monitor after all), but the basics to get you going:

300: A9 00 AA 20 EF FF E8 8A 4C 02 03
            -- Enters series of values starting in address 0300
300.30A     <- Display contents of memory from 0300 to 030A
0300R       <- run the program starting at 0x300
               (character set will be printed, hit reset: <RS> or Ctrl-R)


You need some more Apple-1 knowledge, for instance you should not locate your program at 0x0200, as that is WozMon Workspace (it is where it stores its command line buffer). Anyway, entering a program from hand-assembled hex values is a step up from machines like the Altair (where you toggled in binary values using switches), but next-gen technology like an Apple-1 is quite powerful enough to assemble and disassemble for you.

For this, use the Baum/Wozniak mini-assembler. Originating from an amazing little disassembler that appeared in Dr. Dobb's in 1976, Mike Barry on the 6502 forum backported its later evolution, the mini-assembler, down from the Apple II. The program made its first appearance on the Gigatron (link for story). Wozniak needed just 850 bytes of 6502 code for all the functionality shown below:

FDDDR            -- fire up the mini-assembler (Run from FDDD).
                    Instructions are printed on-screen. Remember: Shift-R
300: LDA #$00    -- enter the same demo program at 0400
 TAX             -- note the leading space before add'l instructions
 JSR $FFEF
 INX
 TXA
 JMP $0302
300L             -- list the program just entered
<Return>         -- return to Wozmon
300R             -- run program
FDDDR            -- return to mini-assembler (to fix bugs & repeat)

<Ctrl-R>         -- reset back into the equally suave ROM of the KIM-1

FDDD <Ctrl-G>    -- aaaand back to the mini-assembler.

If you've ever used a real Apple-1 (emulator), you'll appreciate the luxury of this built-in additional software! It took a long time to load something like this from tape. A manual is here (link).

 

Loading and saving to your terminal/PC:

You can load and save from the terminal emulator using Wozmon's hex dump and hex display functions, similar to what the KIM-1 ROMs offer as well. Make sure your terminal emulator can insert a delay between each character it sends so the 6502 can keep up. TeraTerm is a good choice.

To save:

- type 300.30B if that is the range you want to save;

- start capture on your terminal emulator;

- hit return and once all the data has scrolled by, close and save the captured file.

To load:

- just send the captured file, WozMon will 'type it in'.

Loading and saving to cassette tape through the Apple-1

The optional ACI (Apple Cassette Interface) is included in the KIM Uno. It uses the 1K EEPROM of the Arduino as a virtual cassette tape, and you can save up to 5 files on your 1K of tape space. In the old days, you would spool your cassette to an empty spot, note down the tape counter and start saving. It is now 2020, so this is what you do with today's 'solid state' tapes:

- store a tape counter number (a hex digit between $01 and $FE) in address $17F9

- the tape will instantly 'spool' to that place on the tape

- and you're ready to start saving using the ACI.

The 256 byte ACI ROM is relocated from C100 to F100 to keep things nice and compact on the KIM Uno's memory map. Before you start saving or loading, spool the virtual tape to the right location. In WozMon:

17F9: 03          - 03 is the location on the tape

                   (or actually, the filename, same thing)

Then (you should read the ACI manual (link), or at least this nice summary (link)), but from WozMon:

F100R            - run the ACI ROM from WozMon;

300.30BW         - W as in Write.

Reading is done the exact same way, replacing the W with the R for Read.

See the KIM-1 cassette tape functionality below for some other functions, like getting a directory of your tape; deleting files and initialising the tape. You do need to initialise the tape before you can do the above example of saving.

Getting to know the Apple-1: Links

I found the SB-Project website a great way to learn more about the Apple-1: link. It has an in-depth description of history, hardware and loads of PDF manuals.

Other new features...

Firmware update: New KIM-1 features

In short, tape support and better emulation of the RIOT chips. See the How to Use the KIM-1 page.

Download the new firmware

Click on the button to go to the KIM Uno download section. The top link is the 2020 firmware.

The manual in the download section is still current, but the Apple-1 and tape emulation are not yet described. Read the 'How to Use the KIM-1' and 'How to Use the Apple-1' pages on the web site for now.

Customising the firmware

You can reconfigure the Arduino project to add a different selection of ROMs, but you can also recompile for an esp32 or STM32 microcontroller, see config.h. Pretty much any microcontroller can be wired to the KIM Uno circuit board and especially the esp32 will offer you loads of RAM and Flash firmware space. The cassette tape grows to 1MB in size, and RAM is expanded to a dizzying 20K or so. But the joy of the KIM-1 and Apple-1 is minimalism, you can argue about having 20K of RAM... nobody ever will need so much memory. Nevertheless, more fun to come. A KIM-1 wrist watch is already included in the package for one.

A KIM Uno version for the $25 TTGO 2020 wrist watch is included in the download too. Quarantaine silliness.

Have a look at the source code in the 6502 ROMS

The purpose of the KIM Uno (if there was a purpose, but let's say there was) is to enjoy 6502 code. The active side of that is writing code yourself, either in hex or assemby format. The equally enjoyable passive side is to look at the code in the included ROMs. WozMon is easily understood, it's only 256 bytes after all. The same is true for the mini-assembler and even the KIM-1 ROMS.

You can disassemble them to look & learn from the old 6502 masters. But it's much easier to look at the 6502 source code in the KIM Uno Arduino source code package. Just read roms.c, you'll find disassemblies for all the ROMs there. Plus, a PC-based KIM Uno version that has a built-in debugger/disassembler.

7120711513027485198.jpg

Recommended:

Gigatron - the computer without a microprocessor!

This is a personal web site. Although a real effort was made to trace owners of all illustrations used on the site, please let me know through the Contacts page if you feel that any materials infringe on copyrights or Fair Use. I would like to thank www.old-computers.com and www.oldcomputers.net for the kind permission for the use of some of their pictures.

This site was designed with the
.com
website builder. Create your website today.
Start Now