More information on KB9 and a new faster and smaller version
About small SBC systems
More information on KB9 and a new faster and smaller version
Microchess and MICRO-ADE are two products from Micro-Ware Limited, a company by Peter R. Jennings.
The sources of these two programs have been typed in and assembled by me from August to November 2021, and the resulting binary output is identical to my saved from cassette tape binaries.
All these files (source, binaries, papertape, audio cassette wave files, and manuals) are now
available at the KIM-1 Software page.
In the KIM User Notes there were several KIM-1 games published by Robert Leedom.
A tiny Colossal Cave Adventure, HEXPAWN and Baseball.
With his help and others these games have been typed in again and are playable on any KIM-1 (Reproduction), PAL-1, Kim Clone, Micro-KIM.
In August 2021 I (Hans Otten) typed in the source of MICRO-Ade from the listing in the manual, the output is binary compatible with the binaries I saved from tape and are tested on the KIM-1.
The result is a source identical (in standard MOS Technology assembler format) to the listing and binary identical to the page image. I also made new high quality scan of the manual and the listing.
Micro Ade program source and binary
Scanned manual
Scanned listing
Read in the KIM KENNER archive the source of the enhancements (text by S.T. Woldringh o.a.)
The KIM club enhanced Micro Ade to version 8. Download here the binary with a 2 page command summary.
MICRO-ADE V8
Another KIM-1 game by Robert Leedom.
Thanks to Nils for providing this material, and letting Robert Leedom dig up even more material!
(text by Nils)
Robert ‘Bob’ Leedom published another game called Baseball in the KIM user notes issue 16:
tten.nl/wp-content/uploads/2021/11/KIM1_BB_small.png”>
The “listing” of the game is pure HEX, no source file given in the Usernotes. But Bob has provided that now!
Some information about the game:
– It fits in an unexpanded KIM-1, and is being played with the keypad and the LEDs
– You can find the whole article here http://retro.hansotten.nl/uploads/files/6502%20user%20notes%2016.pdf
– Bob Leedom has digged up much more information than published, like source (handwritten, 16 pages), readable hex dump, photos of the hand controller described next. All part of the downloadable archive.
The Baseball game with instruction
All media and documents and photos about Baseball
There are two game modes:
The pitcher (in one player mode the computer) decides how the ball is thrown. The baseball then flies immediately to the Batter.
The Batter has to time very carefully when to hit with the button B
Nils has played the ‘batting training’ and could not find any errors.
There is the chance to add external switch to give you a better game experience. You can set the pitch on a multi position switch and include two buttons to throw and hit.
Bob sent pictures of his (back in ’79) self build external controls for KIM-1 Baseball
Now this is oldschool. Do you see the self printed circuit board? It fits directly in the KIM-1 extension port!
Special thanks to Bob Leedom, who dug in his basement in the search for all the missing documents, scanning and sending it
New version of the Pascal-M system, run Pascal programs on the KIM-1.
First public beta of the KIM-1 Simulator
Runs in Windows and Linux (everywhere a Lazarus IDE is available, source included).
A KIM-1 simulator with the look and feel of the KIM-1 and a debugger to look ‘inside’
Console, with choice of colors of font and background:
KIM-1 built in ROM tape load and save:
Setup for Windows and Ubuntu and Raspberry Pi 5
Source (requires Lazarus IDE 2.x))
Bundled with Conversion 8 bit hex formats utility, to convert to/from various binary files like MOS Papertape, Intel Hex, Motorola S-record and more.
Hans Otten, 2019- 2024, Version 1.4.0
Contents
The KIM-1 simulator is written for my personal use to aid me in developing and testing software for the KIM-1. It is not meant to be a cycle exact complete KIM-1 emulation. Instead it shows as much as possible what is happening inside. So do not expect it to run the typical KIM games on the LED and Keypad.
Just for fun and a tribute, it looks and feels and functions as a real KIM-1. The debugger is what the purpose of this program is. The program is developed on Windows 10 (32 bit executable) and tested and compiled on and Ubuntu . Since the source is available, it will run anywhere Lazarus IDE is available.
What the KIM_1 Simulator does not do as the real KIM-1:
The KIM-1 Simulator is a KIM-1 with:
Windows
Run KIM1SIMsetup.exe or place the files KIM1SIM.EXE + KIM1Simulator.html file in a folder of choice.
For high DPI screens change the Properties of the KIM1SIM.EXE, Compatibility settings,
– Change high DPI settings,
– check high DPI scaling Override,
– scaling performed by “System(enhanced)”.
Ubuntu 20.04.3 LTS
Execute KIM1SIM from the Ubuntu folder. Works fine on a modern PC.
Note that the font used is Courier New. Install ttf cour.ttf on Linux in .home
Other platforms
If Lazarus is available then install Lazarus (Version 2 or higher) and build from source.
No extra packages are required, just a standard Lazarus.
Open the project KIM1SIM.LPI and do RUN – Build to get an executable.
This may work on MacOS. It seems not easy, Lazarus is not that stable on MacOS it seems.
After installation
Start the KIM-1 Simulator and choose Settings to
– set the default working directory. Otherwise files may appear at locations you do not want!
– select the keyboard layout in the console (Geman and US International for the moment)
Start the emulator main program and push the ‘Run’ icon. Then press the RS key on the keyboard (or type R).
After that the LEDs awake and the keyboard is operational as a KIM-1.
[0] to [F] - Sixteen keys used to define the hex code of address or data [AD] - selects the address entry mode [DA] - selects the data entry mode [+] - increments the address by +1 but does not change the entry mode [PC] - recalls the address stored in the Program Counter locations (PCH, PCL) to the display [RS] - causes a total system reset and a return to the control of the operating program [GO] - causes program execution to begin starting at the address shown on the display [ST] - terminates the execution of a program and causes a return to the control of the operating program
0-9 : key 0 - 9 a-f : key A - F A-F : key A - F + : + A : AD D : DA P,p : PC G,g : GO S,s : ST R,r : RS S,s : ST
Press the TTY switch and run/stop and you have a console terminal. The KIM-1 teletype commands now work and also programs line KB9 Basic can be used. See the Console chapter below.
The KIM-1 tape load ($1873) and save ($1800) programs are emulated.
Fill in the tape ID and optionally start and end address as documented in the KIM-1 User manual.
Start the Save at $1800 and the load at $1873 with the KIM-1 monitor.
You will be prompted for file to load or save.
Use the menu Settings to dipslay the possible settings that survive sessions.
– Set default work folder to choose a folder for all files created or used by the emulator. The settings are saved between sessions.
– Set the preferred keyboard layout (US International German,Belgium (french), others await your input, see below)
Default settings config file : “/home/(user)/.config/KIM1SIM.cfg” or C:\users\(user)\Appdata\local\KIM1SIM.cfg”
Loaded at startup, updated via the Settings menu.
The menu has Load and Save functions, you can load and save to many 8 bit binary formats as MOS papertape, Intel HEX, Motorola S record, binary and simple hex.
The 16 bit versions of Intel Hex etc are not supported.
The Define Type is a text file format suitable for inclusion in assembler source.
The layout is as follows (all in hex)
; <Start address> - <end address> <define text> $<hex data> .. where <define text> is what you fill in the Define text entry, may be empty. Example: ; 1800-1805 .byte $A9 .byte $AD .byte $8D .byte $EC .byte $17 .byte $A9
Press the TTY console switch to let the KIM simulator use a glass teletype in a console window. The standard KIM user interface is shown, see the manual how to use.
Note: set the PC keyboard to CAPS Lock, only uppercase is used in the KIM monitor.
Note the menu options to record a session, (Load Text to Console) or play (Save text from Console, followed by Stop saving text ) a text file in the console.
This is in fact the same functionality as a teletype with high speed papertape punch or reader. You can use this to load and save Basic programs as ASCII text files. Or use the KIM-1 tape routines built in KB9 Basic!
The console is an emulation video terminal (ANSI color, subset) connected to an ACIA (a Motorola 6850) in the KIM-1. The KIM Monitor is patched to send or receive via the ACIA and is transparant to the user of the KIM-1 I/O routines (even the quirlks like flags and returned register values!)
Keyboard input, when the console window has focus, is sent to the serial input of the ACIA. No local echo. The KIM-1 monitor only accepts uppercase (hint: Caps lock!), user programs are free to use upper or lowercase.
Characters sent tot to ACIA output are received by the console window and handled as a VT100 would do, a subset of the ANSI/VT100 is implemented.
All keys of the PC are usable, SHIFT works. Note the translation of codes from the PC keyboard to ASCII characters is for the keybaord choosen in Settings.
Other mappings are possible by changing the routine in console.pas: procedure TFconsole.FormKeyDown
Received characters by the console are handled as follows, a subset of the ANSI set.
Single control character
$01 : CursorHome $04 : CursorRight $05 : CursorUp BS : Backspace TB : Tab LF : LineFeed FF : ClearScreen CR : CarriageReturn $13 : CursorLeft $16 : DeleteToEndofLine $18 : CursorDown DEL : Backspace ESC sequences ESC[K Clear from cursor to the end of the line ESC[0K Clear from cursor to the end of the line ESC[1K Clear from the beginning of the current line to the cursor ESC[2K Clear the whole line ESC[J Clear the screen from cursor ESC[0J Clear the screen from cursor ESC[1J Clear the screen until cursor position ESC[2J Clear the screen and move the cursor to 0-0, defined sprites are removed, loaded bitmaps are kept Insert / Delete ESC[1@ Insert a blank character position (shift line to the right) ESC[1P Delete a character position (shift line to the left) ESC[1L Insert blank line at current row (shift screen down) ESC[1M Delete the current line (shift screen up) Move cursor ESC[H Move to 0-0 ESC[f Move to 0-0 ESC[s Save the cursor position ESC[u Move cursor to previously saved position ESC[(Row);(Col)H Move to row,column ESC[(Row};(Col)f Move to row,column ESC[nA Move the cursor up n lines ESC[nB Move the cursor down n lines ESC[nC Move the cursor forward n characters ESC[nD Move the cursor backward n characters Attributes ESC[m Reset all attributes ESC[0m Reset all attributes ESC[1m bold ESC[4m underline ESC[5m italics ESC[7m Turn on reverse color ESC[27m Turn off reverse color Color attributes color FG BG FG high BG high -------------------------------------------- black ESC[30m ESC[40m ESC[90m ESC[100m red ESC[31m ESC[41m ESC[91m ESC[101m green ESC[32m ESC[42m ESC[92m ESC[102m yellow ESC[33m ESC[44m ESC[99m ESC[103m blue ESC[34m ESC[44m ESC[94m ESC[104m magenta ESC[35m ESC[45m ESC[95m ESC[105m cyan ESC[36m ESC[46m ESC[96m ESC[106m black ESC[37m ESC[47m ESC[97m ESC[107m FG = foreground BG = background High = higher intensity Note that setting colors is implemented in a limited way. Combining attributes and fore/background in one Escpe sequence is not supported If you want to use for example ESC [1;31;104m (bold, red foreground, blue background) you will have to use ESC[1m ESC[31m ESC[104m Printable character (>= $20): placed on screen where the cursor is, cursor moved to next position Wrap around at end of line, screen scroll up when bottom line is reached
Handling different keyboard layouts and platform independent development is a nightmare! The Console in Version 1 and below is built for the US International keyboard, the only type I use.
SInce then some more keybaord layoyts are added, you can select form the Settings.
This means the key code translation is fine for a-z, A_Z, 0-9, with NumLock also for the numeric keyboard, backspace, delete and othr control characters. Fine for the KIM-1 monitor.
The key code translation is now not optimal for keyboards with other layouts, characters like []{}\|;:'”,<.>/?!@#$%~^&*()_+ are possibly mapped wrong.
This can be fixed in a newer version by letting the user select a keyboard layout. But I do not have all those keyboards and the information on the internet is confusing.
So I built a test program to let you help me: Testkeydown. Fill in the type of your keyboard, press at least the []{}\|;:'”,<.>/?!@#$%~^&*()_+ keys, et Num Lock and press the numeric keyboard.
Save to the file keydowntestfile.txt and sent it to me at h.otten (fill in here at sign) hansotten.nl so that I can add your variant to the Simulator.
From the menu Simulator choose Debugger to show the debug window. This windows has step/single step/run buttons, shows the registers and flags, zeropage, memory and the stack. The Trace logfile facility may store a trace of what happened.The disassembler part shows a disassembly.
Several refresh buttons let you update the current state of the machine.
First set the PC to the first instruction of the program to test.
From the Search Memory you can Search with hex 1,2 or 3 bytes in memory (leave unwanted fields blank), Fill memory and Copy/Move memory.
With a fill byte you can replace the moved bytes, leave the field empty to leave the original value.
The disassembler shows locations/labels in hex format. If the assembler symbol table is available (TASM can produce that as blank delimited list) you can load it and do some symbolic disassembly.
Load and show the symbol table from the menu “Symbol table”. Supported symbol table formats: TASM 32 bit and CA65 (part of CC65 suite).
From the menu Simulator choose RRIOT to show a windows with the current RRIOT status or you can enter new values for the various registers.
Press Refresh to update to the current state, it is not updated realtime.
The 6530-002, responsible for the KIM-1 hardware, is decoded to the relevant in/output bits.
Note that the simulator does not perform the KIM-1 LED/key functions this way. Code for output to the LED displays is currently present but commented out in the source.
Timing limiting is essential for this to work, the simulation now runs as fast as the host CPU can deliver.
Available from the ‘watches and breaks’ form or from the Window menu
This facility keeps track (once activated with the Profiling Check box) how much an instruction is executed,
Independent of the debugger, always available.
Use the Refresh button to see the current state, not automatically updated so it is no a high performance hit.
Any opcode, from o to 255, is counted. The display shows the maximum 65C02 instruction set.
You can save the profiler data to a CSV file, with instruction mnemonic and number of times executed per line.
Invalid instructions are marked as ‘Unknown’.
Focal V3D, an interpreter modeled after the DEC PDP-8 Focal interpreter runs on the KIM-1 and on the Simulator.
This program uses a trick to suppress the echoing of charaters typed on the KIM-1 TTY hardware. And another trick to get a hash/random number.
After loading both zeropage and program code, start at $2000. But first go to sSettings and choose Focal Break testing.
Only when running Focal! Set to Normal break testing for e.g. MS Basic. This setting is not saved, and resetting the emulator makes the setting to Normal.
In the Setup archive a folder with TTY programs are collected. Note that manuals etc are on the Retro website.
kb9.bin load 2000 start $4065 Microsoft KIM-1 Basic 9 digits (upercase only, set 00F1 to 0)
kb6.bin load 2000 start $3D50 Microsoft KIM-1 Basic 6 digits (upercase only, ROR instruction patched + CLD)
kb9V2.bin load 2000 start $3F8E Microsoft KIM-1 Basic 9 digits (upercase only, ROR instruction patched + CLD)
kimGFX.BIN load 2000 start 2000 Demo for K1008 video display Dave Plummer
kimGFX1.BIN load 2000 start 2000 Demo for K1008 video display Dave Plummer
kim1sim6502test.ihex start 2000 65(C)02 opcode test (lower case y/n)
Focal folder
Set in Settings Focal3D break setting
focalzp.bin load $0000
focalm.bin load $2000 start 2000
Printing disassembler
PRDISV3.PAP start B000
Note that the font used is Courier New. Install ttf cour.ttf on Linux in .home/pi/.fonts to prevent substitution with artefacts
If and when the ACIA routines and other routines in the KIM1SIM ROM are altered you need to rebuild the KIM1SIMrom.inc file.
Subfolder ‘romtoconst’ contains the binary of the original KIM ROMS (6530-002.bin, 6530-003.bin) and the additional ROM binary with ACIA routines (kimsimrom.bin).
The .inc files for the compilation of the KIM1SIM, to be placed in the main folder, are created with the program creatINC.exe, a console application (source included here).
Copy the the tree .inc files to the main folder and compile the KIM1SIM program again.
D:\myfiles\development\kim-1 simulator\romtoconst\creatINC.exe kimrom002 include file created kimrom003 include file created kimsimrom include file created
Here you find assembler sources of various tests. Assemble with TASM, included in the folder. See TASM.HTML for information.
It is convenient to compile from an editor like Notepad++, plugin NPPEXEC
with command to create intel hex file
"D:\myfiles\development\kim-1 simulator\KIM-1 assembler sources\tasm" -65 -x3 -g0 -s $(FILE_NAME) $(NAME_PART).ihex $(NAME_PART).lst -s $(NAME_PART).sym
"D:\myfiles\development\kim-1 simulator\KIM-1 assembler sources\tasm" -65 -x3 -g3 -s $(FILE_NAME) $(NAME_PART).bin $(NAME_PART).lst -s $(NAME_PART).sym
The MTU Visible Memory is a memory mapped video display made by MTU.
See the K-1008 Manual how it works.
Enabling it will display a form on which the video memory is shown (according the packing of the pixels in bytes, see the manual).
Use the Settings from to enable or disable (default) the K-1008. The base address in memory can be set to what the original board allowed with jumpers.
The K-1008 display can be resized from 1x to 3x. Larger means a slower display, not much effort has been put in making it display fast.
A fourth option is to choose for a correct aspect ratio.
Note that the pixel only appears on screen when the corresponding memory location is written to by the CPU. Use Refresh in the Debugger to force the display.
Using MS Basic: the interpreter will detect the video memory as normal memory. No harm done, MS Basic does not support the K-1008. The memory test of MS Basic is visible on the K-1008 display!
There are several ways an image can be loaded to the K-1008 video display:
How to make a C Header image file with threshold
Make a C Header image file with dithered images
Note there is a command line program in the folder K-1008 load C Header , called LoadK1008 that converts a C header image file to a K-1008 formatted binary.
D:\k1008\LoadK1008.exe h LoadK1008 is a program to convert a 320x200 C header file from GIMP to MTU Visable memory K-1008 image LoadK1008 <C header filename> <K-1008 binary filename>
Prepare the C header file in GIMP as follows:
Also there are examples of C header and binary K-1008 formatted files.
The folder K-1008 load C Header contains the Freepascal source and original JPG files.
Load in Settings the Apple 1 monitor (wozmon) into the free space of the KIM-1 tape ROM.
Start at $1AA0, back to KIM-1 monitor with ‘X’ command.
V1.2x retracted
Screenshot of 1.3.3 with ‘correct’ aspect ratio.
A game by Robert Leedom, published in 6502 user notes #13, 1979. Typed in by Dominic Bumbaco so we can play it!
Paper tape and hex dump of the program
Original article