Showing posts with label 6800. Show all posts
Showing posts with label 6800. Show all posts

Wednesday, November 24, 2021

Retrocomputing Basic Implementations

Here is a summary of a number of Basic implementations that I have come across and worked with as part of my retrocomputing hobby. Many of these were ported by me or others to different platforms from the ones they were originally written for (for example, single board computers based on the 6502, 6809, Z80, and 68000 microprocessors). These are all found on my github  account.

Name Developer Platform Code size Comments
Enhanced Basic (68000) Lee Davison 68000 14K Full-featured Basic for 68K platform
Tiny Basic for the 68000 Gordon Brandly 68000 4K Derived from and similar to Palo Alto Tiny Basic.
Enhanced Basic (6502) Lee Davison 6502 11K Full-featured Basic for 6502 platform.
Microsoft Basic for 6502 Microsoft Apple 2, Commodore, KIM-1, OSI, and others 8K Basic used on several early 6502-based microcomputers.
Tiny Basic for 6502 Tom Pitman 6502 3K Originally published in Dr. Dobbs Journal.
Apple 1 Basic Steve Wozniak 6502 (Apple 1) 4K Basic for the Apple 1, later expanded into Apple 2 Integer Basic.
BBC Basic 2 for Acorn Atom/BBC Computer Roger Wilson (Acorn Computer) 6502-based Acorn Atom and BBC Computers 16K Basic for the Acorn Atom and BBC Computers.
Tiny Basic for 6800 Tom Pitman 6800 2K My version runs on the Heathkit ETA-3400.
Tiny Basic for 6809 Tom Pitman 6809 2K 6809 port of 6800 version.
TSC Micro BASIC PLUS Technical Systems Consultants 6809 4K Similar to Tiny Basic.
Sinclair ZX81 Basic John Grant and Steve Vickers, Nine Tiles Networks and Sinclair Research Sinclair ZX80/ZX81, Timex 1000 8K Basic for the Sinclair ZX81 computer.

Tuesday, February 12, 2019

6809 Single Board Computer: TSC Micro Basic Plus

On the hunt for interesting software that could run on my 6809 Single Board Computer, I came across a small BASIC interpreter.

Originally written for the 6800 processor to run on systems like the Southwest Technical Products SWTPC, Micro Basic Plus was developed by Technical Systems Consultants in 1976 and cost $15.95 for the manual and listing. A cassette tape was $6.95 and paper tape was $6.00. The original version can be found here  and had this marketing blurb about it:


TSC Micro Basic Plus

This is the most complete small Basic available to micro users. Statements include: PRINT, INPUT, READ, DATA, RESTORE, IF ... THEN, GOTO, GOSUB, LET, ON ...GOTO, ON ...GOSUB, RETURN, FOR (with + and - step), NEXT, DIM (single and double dimensioned arrays up to 98 by 98), REM and END. There are also several functions available which include TAB and SPC (for output formatting), RND, ABS, SGN and exponentiation. The commands available to the user are LIST, SCRATCH, RUN, and MONITOR. But the list does not stop here. MICRO BASIC PLUS also includes a complete line editor ability to have multiple statements per line, direct execution of most statements, large arithmetic range (integer only -99999 to +99999), and a very simple load and dump procedure for saving the user's BASIC program on paper tape or cassette and then reloading it at a later time. Also included is an EXTERNAL statement which allows the user to write 6800 machine language subroutines to be called during BASIC program execution.

You are probably thinking all this sounds great, but if the less extensive versions of small BASIC require 23K of memory then this version must require 5 or 6K because the capability is doubled. Well here is the icing on the cake. MICRO BASIC PLUS resides in a fraction over 3K which means that in a 4K system you still have room for a 30 to 60 line BASIC program. For more complex programs, we recommend a system with 8K or more of memory.

One more plus... you not only receive a complete manual and hex dump of the program, but also the fully commented source listing! This is a great aid for learning programming techniques as well as enabling you to alter the program should you so desire.


I found a 6809 port here,  developed by Drexel University to run on their 6809 Single Board Computer. It looks to have been a straight port from 6800 to 6809 mnemonics with the input/output routines adapted to their hardware and monitor.

I ported it to my board, using ASSIST09 monitor routines for i/o. I had it up and running in an evening, and made a few improvements after that. It supports most common BASIC keywords including ON/GOTO and ON/GOSUB and one and two dimensional arrays.

Overall, though, the language is pretty limited as compared to other BASICs with support for integer math only and no string variables at all. This is not surprising given that it is only a little of 3 Kilobytes in size! It is not too different in capabilities from Apple 1 BASIC originally written by Steve Wozniak and later expanded into Integer BASIC for the Apple ][.

I tried a few sample programs and they ran quite well. I made an enhancement it to show full error messages rather than just numbers (which increases the size by another 1/2 K or so). The code is here.

For running real BASIC programs I think I will stick to the port of Microsoft BASIC for the Color Computer, but this is an interesting little program.

Thursday, April 5, 2012

Nostalgic Musing on CPUs

The first processor I learned was the 6502 on an Ohio Scientific Superboard computer. My main resource for learning was the book Programming a Microcomputer: 6502 by Caxton Foster, which was written for the KIM-1 computer but was pretty generic. I wrote a disassembler, a simple assembler, and some games. Later I got an Apple //e and did some more 6502 programming with it, along with BASIC, and Pascal.

Ohio Scientific Superboard


I used a 6800 in university and at a summer job at the university working on an embedded data acquisition system. The graduate student writing the code had no source code, he just typed in the bytes and burned them into an EEPROM! I adapted my disassembler in BASIC from the 6502 to the 6800 to disassemble the EEPROMs and make a hardcopy of the code.

At school I also used a 6800 cross-assembler on a minicomputer for labs on a small KIM-1 like single board computer. I remember it had a minor bug - it assembled the NOP instruction wrong! In a CS course I did a little assembler programming on a mainframe that had 60 bit words - I believe it was a CDC Cyber.

When I started working in the mid 80's I worked on developing equipment for manufacturing testing. It was all custom and used Motorola processors. It started with the 6800 but mostly used 6809 for new development by that time. The 6809 was a big improvement over the 6800 having more registers and addressing modes. You had 16-bit registers and could write position independent code. It could even do an 8-bit multiply! I spent many hours programming EEPROMs or waiting for them to be erased under an ultra violet light so I could test my latest version of code.

Then the 68000 came out and it was an embarrassment of riches to have 16 32-bit registers and a MOVE instruction that could move from anywhere to anywhere. It ran at a blazing 8MHz! I didn't actually do much assembler programming on the 68000 because by then we were mostly using higher level languages like C and Pascal (and a language called Concurrent Euclid that you probably haven't heard of). 

I still have a soft spot in my heart for the 6502 as all the programming I did on it was done for fun. It was the first processor I learned, and it has an elegant simplicity to it.

Actually, I wasn't entirely correct when I said I first learned the 6502. Some time when I was under 10 years old my father introduced me to the CARDIAC computer: CARDboard Illustrative Aid to Computation.  The short book and cardboard model was a hypothetical processor that taught how processors work at the fundamental level. It was a simple CPU with 10 instructions and the student used the cardboard model to execute instructions in a program himself. Copies of the booklet and computer are available on the Internet. Even the original cardboard CARDIAC is still available.

Cardiac Computer
Accompanying Booklet

I remember at the time I found it hard to resolve the wide gap between this explanation of a computer with what I saw in the media, such as the robot in Lost In Space or computer on Star Trek. I was also given a book called The How And Why Wonder Book Of Robots And Electronic Brains that probably set some unrealistic expectations about computers too.

 

On my to do list is to write a simulator for the CARDIAC, probably graphical in C++ using the Qt toolkit.

Tuesday, March 6, 2012

Replica 1 Multi I/O Board

The Replica 1 Multi I/O board kit arrived yesterday and I immediately set about putting it together. It only took me about an hour to assemble.


Parts Laid Out Ready for Assembly

The board has a serial port using a 6551 ACIA, a simple EEPROM programmer, and two 8-bit parallel ports using a 6522 VIA chip. It also has a socket for an optional speech synthesis chip which I didn't opt to get.

It plugs into the single expansion slot on the Replica 1. It has a breadboard area and a connector giving access to the VIA chip ports. A nice touch is a ZIF socket for the EEPROM.

I was able to use the serial port with the supplied modified version of the Woz monitor program that uses the serial port for i/o and confirm that I could load files through it.
View of the Multi I/O Board
I was also able to program the included EEPROM. It simply appears as memory and is writable so no special software is needed to write to it. A nice enhancement to the EEPROM programmer circuit would be a write protect switch or jumper. It is a little too easy to write to the EEPROM and a buggy program might corrupt it. I might add one.
Installed in the Replica 1 Expansion Slot
I'll have to do some experiments with the 6522 VIA. It is more sophisticated that the 6821 chip on the Replica 1 (and Apple 1) having some extra goodies like timers that can generate interrupts.

A bit of trivia: the 6500 processor series from MOS Technology competed directly with the Motorola 6800 series. The short-lived 6500 chip was electrically pin-compatible with the 6800 but resulted in a lawsuit that took it off the market. The Apple 1 could optionally accept a 6800 processor instead of a 6502 with a few circuit changes that were documented in the schematic. Woz chose the 6502 over the 6800 because it was substantially less expensive. The 6500 and 6800 series are similar but not software compatible.
Note on Apple 1 Schematic Describing 6800 Support

Motorola sold 68xx series support chips like the 6821 used in the Apple 1 and Replica 1. MOS Technology offered their own line of 65xx support chips including the 6551 and 6522 found on the Multi I/O board.