Basic interpreters for the 6502

Getting enough memory and bringing up a BASIC interpreter were early goals of many personal computer users back in the 1970s.  While Dr Dobb’s Journal was printing a new small BASIC interpreter for the 8080 almost every month, 6502 users were left out in the cold.  Fortunately, Tom Pittman produced a Tiny BASIC that he charged $5 for.  Microsoft also ported their full floating point BASIC but it was not cheap.

Nowadays the source code for these and other BASIC interpreters are freely available on the internet but usually require the user to jump through some hoops to use them. Ie, setting up a build environment. To make things a bit easier, I’ve put binaries and some sources on this page. These are all quite runnable on a KIM-1 with extra memory. There are no interpreted languages that I am aware of that will run in the 1K KIM-1 although Tiny PILOT from Compute magazine can run in 2K, that’s what I used.

Tom Pittman’s Tiny BASIC

Tom distributed a very small BASIC that needed about 3K to run, and was available on paper tape for $5!!! He has quite a bit about it at:

http://www.ittybittycomputers.com/IttyBitty/TinyBasic/

On there is a KIM-1 version that annoys me a bit. Tom and I worked about 10 years ago to disassemble and produce a really good source code package with a lot of my reverse engineering and his comments about portions of the code he could remember details of. For some reason he put up a poorly commented version Here is the source code, listing, and binary to my disassembly which includes a lot of comments and notes from Tom:

Tiny Basic by Corsham

A ready-to-run binary which loads at $0200 and should have RAM up to $13FF

tinybasic.hex

(see also the Tiny Basic page)

Microsoft 8K BASIC

First, here are complete instructions for building your own version Install the CC65 package, then run the make.sh command, then look at the file tmp/kb9.bin, You’ll need to convert that raw binary image to a file suitable for downloading to the KIM.
Or just use my binary. All of these needs at least 12K of RAM starting at $2000.

(see also the Microsoft Basic page)

Create your own Version of Microsoft BASIC for 6502” — pagetable.com

Binaries

Here is a file suitable for downloading onto a KIM-1. It loads at $2000 but to run it you’ll need to start at $4065. Use the L command in KIM-1’s monitor, then upload the file.  I strongly suggest that you change your terminal emulator so it adds a 200 ms pause at the end of each line.  Once it loads, run it by going to 4065 and running it at $4065 G; To see the easter egg, answer “A” when it asks for memory size.

Original KIM-1 Microsoft BASIC: kb9

This is still experimental but I have a version which uses functions in the xKIM monitor (present on the KIM Clone or on the 60K RAM/EPROM board) to save/load from the SD Card System. It also has a DIR command. This is an Intel HEX file and must be loaded from the xKIM “L” command:

xkim

This loads and runs at $2000.

Bob’s Tiny BASIC

All the early issues of Dr Dobb’s Journal discussed using using an intermediate language (IL) to write a general interpreter, then writing a BASIC interpreter using the IL language.  Nobody used this except for Tom Pittman. I liked the idea and about five years ago wrote my own BASIC using that approach. It is buggy, but the sources are on github so anyone can take them, hopefully debug things, and put fixes back in place. My version also has commands to save/load programs to/from a Corsham Technologies’ SD Card System.

Source code:

Github Corsham

And a binary version that can be run starting at address 0200:

mytb.hex

Versions:
2019 archive
2021 archive

Bob’s_Tiny BASIC
post

KIM Clone Rev 5

After almost a year (2019)of on-again, off-again, development we finally have a new revision of the KIM Clone.

It has everything the previous versions have, but with a few improvements people have asked for (or I wanted):

Expansion bus connectors! This was widely requested. Includes most processor signals, address and data buses, along with bank decoding lines. This is intended to plug into either a prototype board (more on this later) or a motherboard (in the works).
More jumpers to enable/disable blocks of RAM from being decoded. K1-K4 each have jumpers, and 8K blocks for the entire memory map have another set of jumpers. This allows blocks to be disabled on-board, then mapped to a user-supplied circuit.
Power on reset. Not a major feature, but I didn’t like having to press RS every time I turned on my KIM-1.
Power connector and the power switch moved to the top edge of the board.

KIM-1 Clone Rev 5 User manual
KIM-1 Clone Rev 5 User manual, other version

KIM Clone Rev 4

The first version that support expansion connectors.

KIM-1 Clone Rev 4 User manual

post

KIM Clone Rev 3

Changes between Revision 2 and Revision 3 Boards

Revision 3 boards had a number of minor changes to fix know issues on Revision 2 boards. No new features or capabilities were added.
– IC19 was removed
–IC18 changed from 74AVC1T45 to 74LVC1T45
– IC16 changed to 74LS00
– IC7 and IC8 changed to 74LS145
– R37 and R38 changed to 470 ohms
– C18 was added
– IC17 had power routing fixed

KIM-1 Clone Rev 3 User manual

KIM clone versions

In 2017 Bob Applegate started to design a KIM CLone.
He went to 5 versions.
The first were enhanced KIM-1 replica’s without expansion connectors but with lots of RAM and ROM. The later versions and 5 did have expansion connectors, and a Motherboard, I/O board and Protoboard were added.

post

Multifunction and Motherboard

This board combines several existing boards into one, and puts it into a form factor meant for those who have legacy motherboards such as the MTU K-1005, or any other motherboard that brings the raw Application and Expansion connectors to third party boards. It can also be used with the Corsham Technologies KIM Motherboard.

Manual KIM-1 Multifunction and Motherboard

post

KIM-1 RAM ROM 60K board

This is a combination RAM and EPROM board with a fair amount of flexibility for adding more functionality to your KIM-1!

Features:
Fills in the KIM’s missing RAM from $0400 to $13FF, giving you 5K from $0000 to $13FF.
Has RAM from $2000 to $FFF7, selectable in 8K segments.
The top 8K ($E000 to $FFFF) can optionally be replaced with 8K of EPROM on the board (27C64 EPROM).
Includes the xKIM extended KIM-1 monitor by default.
The xKIM monitor has commands to load hex files, dump and edit memory, a memory test, plus commands to access SD card features from our SD Card System.
The extended monitor has vectors to command functions so programs written for it won’t break when new versions are introduced.
This board can be added to any KIM-1 system, but the easiest way to add it is with our I/O Board. This board comes with a ribbon cable that plugs right into the I/O Board with no mess. By default the DIP switches are set so your KIM will have 5K of RAM from $0000 to $13FF and from $2000 to $DFFF. The extended monitor is from $E000 to $FFFF.

KIM 60K RAM ROM Manual
Schematic KIM 60K RAM ROM board
Memory test program

post

KIM-1 60K RAM board

A forerunner of the 60K RAM ROM board.

KIM 60K RAM Manual


post

KIM-1 6530 Replacement board

A very common problem with maintaining 40 year old computer systems is that some of the parts have not been made for many decades, such as the two 6530 chips on the KIM-1. Each contains several timers, 64 bytes of RAM, multiple parallel I/O ports and 1K of mask programmed ROM containing the KIM-1 monitor program. To make things even more complicated, each 6530 is mask programmed with a number of configuration options such as which interface pins and address lines select which internal devices.

Many people, Bob included, have at least one KIM-1 in their collections with a non-functioning 6530. Depending on what failed, the KIM might be quite usable, completely unusable, or someplace in between. For these people, there was little chance of ever fixing the problem because the two 6530s in the KIM are unavailable anywhere… not even on eBay! In an effort to fix his own KIM, Bob borrowed work of other people and developed a small board that can replace either 6530 on a KIM-1.
Basically this emulates the functionality of the non-functioning 6530 by using the I/O ports, RAM, and timers from the 6532 chip, and then having an external EEPROM hold the code that was in the ROM of the original chip.

The board replaced U2 (6530-002) on Bob’s KIM and produces a fully functional system again. This is a prototype board (strange board color) but is identical to the production version otherwise.

For full documentation, schematics, design files, Gerbers, EAGLE CAD files and other technical data please also see Bob’s development notes.

The assembled version is the quickest way, and the easiest. Just set the three jumpers to either U2 or U3 to indicate which chip you’re replacing, remove the old 6530, then plug in this board. Bob strongly suggest saving the original 6530 in case you ever decide to sell your KIM to a museum as a static display.

KIM-1 6530 Replacement board manual
6530 replacement development notes
Schematic KIM-1 6530 replacement
kim-1 6530 design: gerbers, eagle, KIM ROM

post

KIM-1 I/O board


The KIM-1 Application connector has a lot of useful signals on it and our expansion board makes them easily usable, as well as providing an RS-232 interface to the KIM’s serial port. The KIM has a 20 ma loop interface because that was the standard used by mechanical teletypes commonly used as terminals in the early days of the microcomputer revolution. Now we all have RS-232 ports on our computers and our I/O board allows a modern computer to connect to the KIM.
The expander plugs into the KIM’s Application connector. The lower left hand side of the board has a DB-9 connector that mates with a standard cable to a PC serial port.
Just above the serial connector are two standard 1/8″ inch audio connectors for a tape player; some people still like saving data to tape, just like in the old days. If both cables are out then the audio in/out lines are connected; this is perfect for running PLL adjustment programs. There is a jumper to select whether to use the audio high or low connections.
Above the audio connectors is the power connector with connections for +5, +12 (only needed if the cassette interface is used) and Ground. A filter capacitor is present to keep the voltages smoothed out.
Two of the best additions to this board are the POWER LED and KBD/TTY switch. A few people, myself included, have almost pulled board or made other changes while power was on. The handy LED provides an indication that 5 volts is present.
If you’re switching back and forth between the normal KIM KBD operation and using an external TTY device, there is now a small switch located on the board that is clearly labeled as to which position is for KBD and which is TTY.
There are various connectors and a set of switches provided for feeding the K1-K4 lines to an external memory board, such as our 4K or 60K memory boards. Each K* signal is individually selected, so if you have peripherals in any of the K1-K4 banks, you can disable any of those signals from going to the external board.
All of the remaining I/O lines are brought to a header for expansion.

Manual KIM-1 I/O board Rev C

Rev B 2006