Another book scanned and available on the Books page:
How to Build a Computer-controlled Robot (with a KIM-1) by Tod Loofbourrow, written when he was 16!
About small SBC systems
Another book scanned and available on the Books page:
How to Build a Computer-controlled Robot (with a KIM-1) by Tod Loofbourrow, written when he was 16!
I bought MAE in 1980 for Use Schroder, Ingenieur bureau Schroder, as a package for the KIM-1. As did some friends in the KIM User Club in the Netherlands. The manual and the binary on this page have survived. And it still runs on the KIM-1 (Simulator).
I never really used MAE then. The MICRO ADE package was perfectly adapted to the KIM-1, especially the use of two computer controlled audio cassette drives and easy to use.
Both MAE and MICRO ADE were using non-standard 6502 assembler syntax, so no advantage there also. The biggest failure for me was not using KIM-1 tape format for sources and object code, but the Fast Cassette solution. So I and others put it aside.
Reconstructed source by me of Eastern House Software, Carl W Moser, ASSM/TED Macro Assembler and Text Edit, MAE, adapted for the KIM-1
Based upon original binary dumped in 1980 by me, Hans Otten, to tape.
The source is typed in by me, starting with the disassembly and the CWMOSER.TXT (from an Elektor Junior tape) and the Fast Cassete source file as comment source.
The resulting binary is identical to the tape dump.
The binary original “CW MOSER assmted.BIN” runs on the KIM-1 and the KIM-1 Simulator
Load at $2000, start at $2000
Note: The KIM-1 Simulator has on the console window a right click menu, choose Add LF to CR.
Source and binary of MAE for the KIM-1 |
Here some screenshots of a small demonstration of using MAE to develop software, without the need for tapes.
The assembler directive .OS is teh key for letting MAE store the assembled code in memory. BRK to enter the KIM-1 monitor, warm start to return.
Works pretty good! The last two images of the KIM-1 Simulator show how to look ‘behind’ at what is happening
MAE (Macro Assembler Text Editor) or ASSM/TED is a program sold by Eastern House Software for the KIM-1, Apple, PET, C64 and more 6502 based machines.
RAE was the name by Synertek for MAE, as ROMs for the SYM-1 which could be installed to add the Resident Assembler/Editor (RAE). Synertek contracted Eastern House Software to port their Macro Assembler/Editor (MAE) into an 8 KB ROM. AS you can see in the reconstructed source, the adaptations were not much more than adding the SYM-1 I/O such as character I/O and tape handling, the essence of MAE stayed as RAE. It was not that popular in the SYM-1 world, even Synertek used internally another assembler, with more MOS Technology compatible syntax.
The author of MAE and RAE, was Carl Moser. MAE was sold in various forms not only for the KIM-1 and SYM-1 but also for other 6502-based computers including Commodore, Atari, KIM, and Apple and in the Netherlands the Elektor Junior. Other forms of MAE included a cross assembler for 6800 and 8085.
Carl Moser and JR Hall were founders of Eastern House Software, the company that created several products for Atari 8-bit users, including Monkey Wrench and Monkey Wrench II, and the KISS word processor.
On topic on this site are the preserved KIM-1, SYM-1 and Elektor Junior versions. I have binaries, manuals and (reconstructed) sources for these versions for download.
Note that the manuals for the SYM-1 RAE are well written, and a good addition for the manuals of MAE.
On this page:
Eastern House Software Catalog | |||
Eastern House Software Dealer Brochure | |||
EHS catalog 1985 | |||
EHS catalog | |||
EHS flyer | |||
EHS Gazette 1981-03 |
To get text into and out of the ASSM/TED program on the 6502 computer to the PC world,one can use several methods.
Written in Freepascal. Sources included, can be compiled in Linux etc.
The first method is using a terminal emulator and upload a text file or catch the output of the ASSM/TED program.
That gives some problems, mostly related to missing line numbers, or too much blanks.
Strip Blanks
The output of ASS/TED to the screen contains many blanks. When you want to uplaod the captured output, those blanks have to go
D:\myfiles\MAE\PC tools>StripblanksMoser.exe V1.0 Strip blanks from captured ASSM/TED Moser source file V1.0 Hans Otten, 2024 Syntax: StripBlanksMoser <sourcefile with blanks> <output source file to upload to ASSM/TED> [Y] Y to overwrite outputfile without question asked
Add numbers
When you have a MAE/RAE source file without numbers, you can add those with this utility, increment of 10.
D:\myfiles\MAE\PC tools>AddNumbersMoser.exe V1.0 Add numbers 0001-9999 to source file to make a ASSM/TED Moser source file V1.0 Hans Otten, 2024 Add numbers 0001-9999 to ASSM/TED Moser source AddnumersMoser <sourcefile without numbers> <output source file with numbers> [Y] Y to overwrite outputfile without question asked
The other method is to dump or upload the text buffer as memory binary dumps.
Text is stored in memory as:
e.g.
the text
10 test
is stored as:
00 10 20 74 65 73 F3
RAE to TXT
Converts a binary MAE/RAE file to an ASCII text file without line numbers and normal line end
D:\myfiles\MAE\PC tools>RAEtoTXT.exe V1.0 Convert a ASSM/TED Moser RAE memory dump to text file V1.0 Hans Otten, 2024 RAEtoTXT <sourcefile memorydump> <output text file [Y] Y to overwrite outputfile without question asked
TXT to RAE
Converts a text file to binary RAE format, with line numbers.
D:\myfiles\MAE\PC tools>TXTtoRAE.exe V1.0 Convert a text file to ASSM/TED Moser RAE memory dump V1.0 Hans Otten, 2024 TXTtoRAE <textfile > <output memorydump file [Y] Y to overwrite outputfile without question asked
Dump
Start ASS/TED and add some lines
C 1979 BY C. MOSER 4163-53FC 5400-5EFC 5F00 4163 5400 >10test >20 lege regel >set 4163-53FC 5400-5EFC 5F00 4176 5400
Current (4176 in example above is to be stored at D3 (low), D4 (high))
BR to the KIM monitor and save 4163 to 4176 to a file, remember the end address, add that to the filename!
Upload
– Start ASSM/TED and BR to monitor
– Load the text file, place the end address in D3 (low), D4 (high)
– Enter ASSM/TED via the warm start at 2003 (KIM-1) or B003 (SYM-1)
The Apple 1 and the KIM-1 are some of the earliest 6502 systems made.
Both are desirable, Apple 1’s sell for lots of $$$ and KIM-1s are getting more expensive.
Luckily we can build a KIM-1 clone that is either cheap and compatible, like the PAL-1, or a bit more authentic as the various KIM-1 boards.
Anyway, a clone has the KIM ROMs, and in E(E)PROM, to make it a KIM-1 clone. Altering is not done, you loose that unique spartan user interface!
The Apple 1 has also a monitor program, often called Wozmon to honor the genius of Steve Wozniak.
And you can combine both user interfaces on a not expanded KIM-1 clone!
I also included the Wozmon as a Setting in the KIM-1 Simulator.
The Apple 1 monitor (Wozmon) to be included in the empty space in the KIM-1 tape ROM
The Apple 1 and the KIM-1 are some of the earliest 6502 systems made.
Both are desirable, Apple 1’s sell for lots of $$$ and KIM-1s are getting more expensive.
Luckily we can build a KIM-1 clone that is either cheap and compatible, like the PAL-1, or a bit more authentic as the various KIM-1 boards.
Anyway, a clone has the KIM ROMs, in an E(E)PROM, to make it a KIM-1 clone. Altering is not done, you loose that unique spartan user interface!
The Apple 1 has also a monitor program, often called Wozmon to honor the genius of Steve Wozniak.
And you can combine both user interfaces on a not expanded KIM-1 clone!
Ronny Ribeiro, a user of a PAL-1, saw that the KIM tape ROM has quite some unused space. In a real KIM-1 that is wasted, you cannot program the ROM.
In a clone you can. He saw that that free space is large enough to hold the Wozmon, adapted a bit for the KIM-1 TTY I/O.
He offers a ROM image for a clone, with the Wozmon built in at 1AA0. And added a command to go back to the KIM-1 monitor.
He also replaced the ‘KIM’ prompt in hi system with ‘PAL.
Two versions here, original KIM ROMs in 2K image (00 filler bytes!) with Wozmon in tape ROM empty space (and no change to text in the KIM ROMs)
– wozmon kim rom zp24.bin with zeropage used from $24 as original Wozmon
– wozmon kim rom zpe5.bin with zeropage used from $E5 just below start of KIM-1 monitor zeropage
Start Wozmom at $1AA0, used buffer at $0300
Based upon the ideas and work of Ronny Ribeiro.
Source included. Standard 6502 assembler, I used TASM32
The KIM-1 Simulator is used to test this. And this Wozmon is now available in Settings!
Here I offer you that ROM. I reconstructed the source and added the result to the KIM-1 ROM image. WIthout the KIM prompt change!
In the archive you find source etc of the Wozmon for KIM, the binary ROM image to load in the KIM clone rom, the original Wozmon source and a small userguide by San Bergmans.
KIM-1 and TIM Simulator have seen a small update.
Improvements on console handling and little annoyances. Focal added as programming language, for KIM-1 and TIM!
The Apple 1 Monitor, wozmon is now available as a Setting to be added the not used space in the 6530-003 tape ROM.
KIM-1 Simulator 1.4.0
TIM Simulator 0.6beta
Convert Hex Formats 2.8 (bundled also with simulators)
Focal on the 6502, a page on this small language, originating for Digital Equipment.
A small interpreter (about 5K) for a convenient interpreted language. Floating point 9 digit accuracy. At least two versions were distributed around 1977, one by Aresco, called “Focal V3D” and another by the Program Exchange as representative of the Denver 6502 Group, often called “Focal-65E”
Latest addition is a reconstruction of the source, by Wayne Wall of the Denver 6502 Group in 1977, of Focal V3D for the TIM to binary, and a port to the KIM-1.
Based upon a listing of the TIM Focal-65 from 1977 and a Focal-65 User manual, repaired and cleaned up.
And that enabled the reconstruction of the soource Focal-65 V3D as distributed by Aresco!
Focal on the 6502, a page on this small language, originating for Digital Equipment.
A small interpreter (about 5K) for a convenient interpreted language. Floating point 9 digit accuracy. At least two versions were distributed around 1977, one by Aresco, called “Focal V3D” and another by the Program Exchange as representative of the Denver 6502 Group, “Focal-65″ or FCl_65” or “FCL-65E”
Information from the German 1981 article in MC Magazine, see the articles, indicates the existence and sale of Focal versions by the 6502 Program Exchange:
I suppose this list is incomplete, other versions may have existed. None but my binary of Aresco Focal-3D, the Aresco V3D Userguide, a User Guide by the Denver 6502 group and a listing of Focal-65 V3D for the TIM survived and is available.
Latest addition to this page is a reconstruction of the sources, of Focal V3D for the TIM to binary, and a port to the KIM-1. Also the Aresco version source is reconstructed and identical to the tape dump of 1978.
On this page you will find:
In 1979 my good friend Anton Muller, at a meeting of our Dutch 6502 KIM Club, surprised me with a package Anton had imported from the U.S.A. : Focal V3d by Aresco.
The package came with a cassette tape and a user manual. We installed it on the KIM-1 and played with it. Impressive what was done in about 5K!
Floating point, string handling, a trick to suppress the hardware echo of TTY input.
After an article in our club magazine more members of the club became Focal-65 users and published articles about it.
This version of Focal-65 has survived. I have dumped a working version from cassette in 2004 (not the original alas, but a working copy with a bit too much) and scanned the user manual.
Manual and binary version have been available on this website now several years. Also I added DEC Focal manuals, Digital Equipment Corp. developed and sold Focal as a product for the PDP computers. In the KIM/6502 User notes articles were published on making Focal even more interesting, also published here.
When the KIM Simulator became usable, I tested Focal and saw that suppressing the TTY echo worked, but the wait for keyboard input loop preceding the read character routine did not. So I added a setting to let Focal-65 survive that loop. So Focal-65, Aresco version, runs unaltered on the KIM-1 Simulator!
The FOCAL programming language |
In 2023 a source listing appeared, thanks to Paul Birkel, of Focal-65, programmed by Wayne Wall and friends in 1977. Target system is a TIM such as Jolt or Superjolt. I typed in that listing exactly with modern assembler syntax and made that version operational.
Here I present several reconstructed versions, for TIM (653-004) such as Jolt and KIM-1 based systems.
– A TIM/Jolt/Superjolt system needs minimum 8K RAM in lower memory.
– The KIM-1 needs memory, minimum 8K, from $2000 and up.
See below for the TIM version and a port to KIM-1. These are 90% identical to the Focal-65 V3D Aresco version, so that was the start to recreate that source too .
First some downloadable reference material.
DEC-08-AJAB-D PDP-8-I FOCAL Programming Manual. Focal by DEC is the beginning of all Focal implementations. A typical DEC manual, easy to read, complete, well organized. |
|
DEC-08-AJBB-DL Advanced FOCAL Technical Specification April 69 This manual is where Wayne Wall got his design. From the flowcharts and labels, similar names and concepts can be found in the Focal-65 source |
|
Focal-65 users guide V3D, by Aresco | |
Focal-65 Users Guide V3D by the Denver 6502 Group. Cleaned up version made by me. |
|
TIM Focal-65 V3D source listing Cleaned up version made by me. |
KIM/6502 User notes
Articles from the magazine, Focal corner
KIM Kenner
Introduction to FOCAL, how to program, Dutch
Compute II
Modify and Move FOCAL 65-E into EPROM, Compute II Issue 3
MC Magazine
German article on Focal-65, has interesting information on versions
In 2023 a listing of Focal-65, by Wayne Wall, for a Focal-65 version for the TIM, showed up, thanks to Paul Birkel.
A low low quality scan, so I cleaned it up, improved contrast, removed artefacts and cropped it. The result is readable, but not fit for OCR.
TIM Focal-65 V3D source listing Original printed listing 1977 by Wayne Wall. Cleaned up version. |
I typed this source in, exactly as the listing: uppercase, same comments, same line numbers.In this way I honor the original author and also enable checking of the binary result.
I did change the assembler syntax to a modern assembler. The original was written for PAL-65, an assembler by Wayne Wall in PDP macro assembler format.
When it assembled I compared the binary out to the binary in the listing by hand. Of course typos and the curse of direct addressing, the #!, caused some extra work.
The result was a binary with the same length. as shown in the listing.
Then the binary was loaded in my TIM Simulator, with a small external patch for the ‘no echo’ input character routine in the source. The TIM has ‘software echo’ hardcoded in the monitor for reading a character from TTY, so the monitor code is copied with optional echo.
It runs!
Focal-65 for the TIM, here the source as typed in, listing, binaries in Intel hex and Papertape format and the TIM Simulator patch.
To illustrate how easy it is to adapt Focal to other 6502 systems, I ported the TIM version to the KIM-1.
Changes required:
This version runs fine in the KIM-1 Simulator with the Focal V3D setting.
Focal-65 for the KIM-1, here the source as typed in, ported to KIM-1, listing, binaries in Intel hex and Papertape format
Here the original Aresco Focal V3D dump from cassette. Note that the dump contains a bit more than necessary. The zeropage is completely dumped, and filled in by a running Focal session.
It runs on a KIM-1 and on the KIM-1 Simulator with the Settings – Type of Break setting set to Focal V3D.
First attempt to get a source, unfinished, does not assemble, but informative.
Disassembled source by Paul R. Santa-Maria (2004) and Hans Otten (more comments) (2022).
Focal-65 users guide V3D, by Aresco |
With the source of the KIM-1/TIM and the binary of the Aresco version I have since 1978, it was an easy job to reconstruct the source of the Aresco version.
By comparing the binary output of the assembled source and the binary of the tape, differences can be seen and fixed in the source.
The interpreter code is 100% identical to the tape dump (minus the extra unused bytes saved at the end). Zero page is clean.
The code runs in the KIM-1 Simulator with the Focal V3D setting. No surprise, the binary of the tape dump also runs and the binaries of the code are identical.
Excerpt from the history of the Denver 6502 Group.
In 1975, Denver was a hotbed of computer activities. There was a new computer club called the Denver Amateur Computer Society (DACS), and every meeting was packed with radio amateurs and hobbyists anxious to learn about this exciting new technology. DACS was dominated by Intel 8080 based computers, but there were a few people interested in the 6502. Wayne Wall was one of the first to appreciate the power and speed of the 6502, and he decided to form a subgroup of DACS for 6502 users.
Wayne was a genius assembly language and systems programmer who worked at the Colorado School of Mines. He began holding meetings every Tuesday night at the School of Mines Computing Center for anyone interested in the 6502. At first it was called the 6502 sub-group of DACS, but as time went on, it became the 6502 Group.
All told, there were probably about 100 members, but on a typical night, 30 to 40 people would crowd into the meeting room, anxious to hear Wayne’s latest ideas and see his demonstrations. He was famous for his magic shows that invariably consisted of doing something hitherto unimaginable like simulating human speech with 13 bytes of assembly code. Wayne quickly gained the well deserved reputation as a computer wizard.
Most members of the group owned Digital Group systems. The Digital Group was a local company that had a short but spectacular career manufacturing computer kits. They were powerful, easy to assemble and way ahead of their time, with memory-addressable video cards, system monitors and relatively large memory boards. In addition to the Digital Group systems, the group had a scattering of Kim’s, Tim’s, Jolt’s and even a few odd homebrew machines.
At the time, there was virtually no software available for the 6502. All programs had to be tediously hand-assembled and typed into the machines. Wayne decided that his first task was to find a way to deal with this problem.
The School of Mines had a huge black mainframe called a PDP-10, and Wayne wanted to use the power and capabilities of this computer to write 6502 code. The first possibility was to use a FORTAN cross-assembler that was available from MOS Technology, but it was slow and buggy. Instead, Wayne chose to write 6502 macros for the PDP-10’s “PAL” assembler. After a few days work, Wayne had a fast new assembler that he called “PAL-65.” Suddenly we had the ability to write relatively large assembly language programs for the 6502.
Initially, Wayne cranked out a series of assembly language games. The first was a simple text based game where you shot arrows at a mythical beast called a Wumpus. Most of our computers had between 512 and two kilobytes of memory, but as Wayne’s games grew in complexity, we struggled to keep up, spending our nights soldering memory chips onto circuit boards.
Wayne now turned his attention to a high level language. The Intel based microprocessors had a version of BASIC written by Microsoft. Wayne decided that we should have a similar language, and he chose to write a version of the DEC language called FOCAL. Even though it was a relatively obscure language, FOCAL had some subtle advantages over BASIC, the biggest was its ability to evaluate strings as expressions.
Wayne wanted FOCAL to be a group project, and one evening he showed up with a stack of photocopies of the DEC flowcharts for the language. His plan was to assign each section of the chart to one of the 6502 Group members. We were supposed to go home, write 6502 assembly code for the section, and in a few weeks, we’d have an operating version of FOCAL. Unfortunately, Wayne had overestimated our skills. Most of us had been assembling code by hand and had no idea how to work from a flow chart. In the end, Wayne and Bob Ulshafer did most of the coding.
When it was finally finished, FOCAL was a big breakthrough. Suddenly we had a true programming language. Complex new games began to appear on our computers including a version of the famous mainframe game Star Trek, written by Larry Fish. Over the next few weeks Wayne wrote a five-byte floating point package for FOCAL based on a Dr. Dobbs article. With the new floating point power, simulations and mathematical programs sprouted up everywhere.
With thanks to Paul Birkel for the scan of the listing.
I have made some small updates to four of my programs.
Updates are bugfixes, cosmetic changes to also to let Raspberry Pi OS versions work, a nicer looking Windows setup and in general bringing all the programs to the same level.
Convert 8 bits hex formats V 2.7
KIM-1 Simulator V 1.3.9
TIM Superjolt Simulator V 0.5
SerialTester V 1.1
Tiny Basic interpreter Copyright 1976 Itty Bitty Computers, used by permission
On this page information how to run Tiny Basic, by Tom Pittman, for the KIM-1 or a TIM (RRIOT 6530-004) based machine, like Jolt and Superjolt, with 4K RAM at least extra.
Any 6502 machine with character I/O can run Tiny Basic, source is available with just a few changes to be made to I/O, memory layout and breaktest. Note that most of the zeropage is used by Tiny Basic!
All tests and binary file manipulation with Tiny Basic have been done with my KIM-1 and TIM Superjolt simulators.
File conversion between binary and papertape and such is done with the Convert Hex 8 bit formats utility.
On this page you find:
Here I present you with all I own, know and have reconstructed about the 6502 (and 6800) ports of Tiny Basic by Tom Pittman.
1979 I bought a Tiny Basic package for my KIM-1 from the Dutch distributor Ing Bureau Koopmans for Hfl. 25,- and the package came as a number of documents (User manuals, Getting the most out of Tiny Basic, and the Experimenters kit) and a cassette with two versions of Tiny Basic program in KIM-1 audio format:
– a low version of the program from 0200 to $0AFF, start address $0200
– a high version from $2000 to $28FF, startaddress $2000
– a Break test routine placed in the lower stack page, $0100-$0114
In 1979 I build a videoterminal (24×32 uppercase monochrome!) and the KIM-1 had 4K memory added in lower memory. So I could use Tiny Basic!
In 1980 I published, in the Dutch KIM Computer Club Magazine KIM Kenner, an article about Tiny Basic, with some patches and tips.
In 2004 I scanned the manuals and dumped the audio cassette wich contained the only remaining Tiny Basic files on cassette. Not the lost original but patched versions as described in the KIM Kenner article I wrote in 1980, reproduced below. I tested those ‘raw’ dumps on the MicroKIM when it appeared as first KIM Clone and it ran more or less. A teletype with papertape punch and reader is not equal to a modern videoterminal.
In the years following more KIM Clones appeared such a the Cosham KIM Clone and the PAL-1. And Tom Pittman published some of the material. Other users used my and Tom’s material to let Tiny Basic run on their KIM clone machines. Also sources based on disassembly were constructed.
In 2021 the KIM-1 Simulator was born, that enabled me to dig into programs at the PC.
2023 brought me a Superjolt with Tiny Basic in ROM. And that triggered me to build a TIM Simulator. With that I could test and check the Tiny Basic ROM dump. With sources from the website of Tom Pittman I could rebuild the assembler source of Tiny Basic, and check that with the dumps I had of KIM-1 and TIM. You can see the results of that work in the Download section: Tiny Basic can be built for my two platforms on any 6502 system, be it KIM-1, TIM/Superjolt or any 6502 with character I/O. I also found that not all Tiny Basic version come with the same IL Basic interpreter, small differences between KIM-1 and TIM/Superjolt. More on the IL interpreter here
The official manuals that came with my version of Tiny Basic. Cleaned up PDF versions 2023.
For a ‘tiny’ language it is very well documented! I have more expensive Basic interpreters without good documentation ..
From the manual on the KIM-1:
It is recommended that you save a copy of memory on tape (0100-0114 and 0200-0AFF) before going any further. Or you may prefer to save it on audio cassette. Set up the starting address for Tiny at 0200, and type “G”. Because of the awkwardness of putting memory in the 4K gap left in the KIM-1 system, an alternate version is available which executes out of 2000-28FF. For this version the Cold Start is at 2000 and other addresses are at 200x instead of 020x (cf. 010x in Appendix D).
Tiny Basic binaries and sources for the KIM-1
– raw dump contains the dump of the only remaining audio cassette files in my library.
Dumps made in 2004, lightly patched versions.
– patched original binaries: extracted from the raw dumps as described in the user manual
– original reconstructed binaries, source versions, binaries checked against the original dump with the patches removed
– patched versions , for practical use on a KIM-1 or clone with a modern video terminal emulator.
Sources and papertape included.
Tiny Basic for the TIM 6530-004 as used in the Jolt and Superjolt. All with sources and binaries..
– original ROM dumps from the Superjolt
– source and checked binaries reconstruction
– patched for more practical use, source and binaries for Superjolt and TIM
– reconstructed version of Tiny Basic for TIM as described in the User manual
Tiny Basic for CC65 assembler sources
Tiny Basic programs, such as adventure
Bill O’Neill source of Tiny Basic with monitor
Tiny Basic source by Bob Applegate
Tiny Basic for the Cosmac 1802 by Robert Coward
Tiny Basic is implemented like an onion:
The concept of Tiny Basic was thought of by the people behind PCC magazine, which evolved ito Dr Dobbs. A compact Basic interpreter written in the IL language, which in turn is interpreted in native code. This means lot of functionality in a small space. And porting to other computers means only having to rewrite the quite simple IL interpreter.
Tiny Basic by tom Pittman is such a ported Tiny Basic. For 1802, 6502 and 6800 CPU systems. Note that there are small differences between versions of the IL code. The code for TIM is different for example of the KIM-1 versions.
Information on the Itty Bitty Computers Tiny Basic for the Cosmac here, by Herb Johnson.
Tiny Basic interpreters 6502, 1802, 6800, IL
Tiny Basic for the Cosmac 1802 source, by Robert Coward
6800 source reconstructed by Jeff Trentor.
Tiny Basic for the 6800 hex dumps and source reconstruction
The dialects of Tiny basic
Tiny Basic debugging
H.J.C. Otten, KIM Kenner 10 March 1 1980, page 10
With improvements on the Dutch article from unpublished handwritten notes, 1980
Tiny Basic
Tiny Basic deserves more appreciation as programming language than the low price makes us wonder.
(Note 2023; All software for the KIM-1 is free nowadays!)
The following article some advantages and disadvantages wil be described followed by some tips for improvements and ease of use.
Advantages of Tiny Basic
The program is small, 2.5K RAM besides zeropage is enough for the software.
Tiny Basic uses the KIM-1 I/O with the built-in KIM-1 character I/O routines. And of course a TTY like a videoterminal.
Tiny Basic comes in two versions. A low memory version for a KIM-1 with RAM at $0000 – $0ABF and program storage at $B000.
The high memory version starts at $2000, and program storage above.
There are no differences between the low and high memory version besides memory locations.
All I/O of Tiny Basic uses three well defined and documented subroutines, adaptation to other 650 systems requires no more adaptations.
The extensive documentation makes all clear.
Tiny Basic has two start addresses. The Cold start does a complete initialization like a clean program space. The Warm Start keeps the Basic program in memory intact.
Besides the Basic statements there is the USR function to call external 6502 code. The USR function is powerful. The first argument is the address of the 6502 routine.
The second argument, a 16 bit integer, is placed in the X (high) and Y (low) register. The third argument, an 8 bit value, in the Accumulator..
The result of the function result is the accumulator.
Tiny Basic works with 16 bit integers, signed. There are USR calls for peek and poke function.
Disadvantages of Tiny Basic
Any Basic interpreter has known disadvantages. Tiny Basic adds having only 16 bit signed integers, no floating point numbers. No string functions, no FOR .. NEXT, GOTO required, 26 variables max. And Tiny Basic is slow due to the architecture of an interpreter written in the IL interpreter.
Tip 1: Patches go improve usability on video terminals
– The “:’ used as prompt can be replaced with another character. I like ‘>’ as prompt.
– The second patch involves suppressing the video terminal unfriendly output of (un)printable characters.
– Third the backspace character $5F is better replaced with $08 for video terminals.
– The last patch increases the maximum stack depth from 40 to $20.
Patches to apply at Tiny Basic (low version 0200 and high version 2000):
Change location $0971 ($2771) to $3E (‘>’ , was ‘:’ $3A)
Change location $0211 ($2011) to $00 to suppress padding (was 84, padding on in bit 7, 4 times)
Change location $020F ($200F) to $08 (backspace) was $5F
Change location 0213 ($2013) to $20 for more stack space depth (was $04)
Tip 2: Load and save of Tiny Basic programs
There are no Load and Save statements in Tiny Basic.
But it can be done with the following procedure on the KIM-1:
Save your program
1. Halt your Tiny Basic with Reset
2. Copy the contents of $24 to EAL $17F7 (end of Tiny Basic Program storage)
3. Copy the contents of $25 to EAH $17F8
4. Fill SAL $17F5 with $00
5. Fill SAL $17F5 with $0B (0200 version) or $29 (2000 version)
6. Enter tape ID in $17F9
7. G $1800 to save to tape (or a more applicable hypertape routine)
Load a program from tape
1. Start Tiny Basic Cold start (G 0200 or G 2000)
2. Halt your Tiny Basic with Reset
3. Enter ID in $17F9
4. G $1873 to load tape to memory
5. Copy the contents of EAL $17F7 to $24(end of Tiny Basic Program storage)
6. Copy the contents of EAH $17F8 to $25
7. Start Tiny Basic with warm start G $0203 or G $2003
Since the KIM-1 monitor does not allow to use the tape load/save routines as subroutines, making this a program is not much more friendly than the manual operations.