KIM-1 Case

The KIM-1 came from MOS Technology and Commodore without a case or power supply. So you either build your own housing or looked at what other firms sold for the KIM-1.
There was a lot on offer, mostly targeted at system expansion with large cases.

One of the cases you saw quite often was this case. It came with one of my KIM-1’s. Small, simple and effective

A perfect solution for an unexpanded KIM-1. Quite popular in education. Add a power supply and you can start using it without exposing the electronics. The LED display was behind a red plexiglas cover, so that improves readability.

B.E.M. photos made by Gerben Voort

Brutech, a small Dutch company, made industrial quality microprocessor systems. 6502, 6809, process control.

Gerben Voort acquired a 6502 system and made photos of the system. A backplane, the BEM bus, a 6502 based CPU card, a double VIA card, a battery backed up memory card.
Read more about Brutech here.

KIM-1, what changed in the Revisions?

I know of seven KIM-1 revisions, labeled Rev A-G and the first one unlabeled. Rev C is unknown!

What changed between these revisions?

Not much. The PCB underwent several changes around the logo area, from KIM-1 MOS to Commodore C-MOS. That happened from Rev A to Rev D, indicating the takeover by Commodore of MOS Technology. And some small numbers/artefacts etched in various Revs. The big change was in the clock circuit between the first edition and Rev A.

Some have serial numbers, the first ones on the back on the right, later had stamped/written numbers like PAxxx (Palo Alto) and SCxxx (Santa Clara) of Commodore production facilities

Clock circuit change
The first batch of KIM-1 suffered from the issue that the clock would not start. It was fixed in Rev A, with more components and a change in PCB layout.

Read more

Jolt replica by Eduardo Casino

Eduardo Casino has created a faithful replica of the Jolt single board computer. Tested! Working!
The replica design is available on GitHub, A faithful reproduction of the JOLT

More on the Jolt here.

A faithful replica of the Microcomputer Associates Inc. JOLT computer, based on photos and information gathered from various sources on the internet.

The JOLT was the first 6502‑based computer kit to be commercially released, beating the KIM‑1 to market by several weeks; the latter would launch in January of the following year. It is a small SBC featuring a 6820 PIA and the 6530‑004 RIOT, also known as TIM‑1. It includes 512 bytes of RAM, a teletype interface, and an RS‑232 interface. The 6530‑004 contains, in its 1K ROM, the monitor software DEMON, also simply referred to as TIM.

post

Jolt Replica by Eduardo Casino

Eduardo Casino has created a faithful replica of the Jolt single board computer. Tested! Working!
The replica design is available on GitHub, A faithful reproduction of the JOLT

A faithful replica of the Microcomputer Associates Inc. JOLT computer, based on photos and information gathered from various sources on the internet.

The JOLT was the first 6502‑based computer kit to be commercially released, beating the KIM‑1 to market by several weeks; the latter would launch in January of the following year. It is a small SBC featuring a 6820 PIA and the 6530‑004 RIOT, also known as TIM‑1. It includes 512 bytes of RAM, a teletype interface, and an RS‑232 interface. The 6530‑004 contains, in its 1K ROM, the monitor software DEMON, also simply referred to as TIM.

Here a proposal for a Bill of Material shopping list

BOM Jolt V3

U9 6530-004 NOS
U1 6502 NOS
U8 6821 NOS

U2, U3, U4, U5 2111 NOS

U6 74LS27 Mouser 595-SN74LS27N
U7 74LS00 Mouser 595-SN74LS00N
U13 74LS04 Mouser 595-SN74LS04N
U12 CD4081BE Mouser 595-CD4081BE

U10 1488 SN75188 Mouser 595-SN75188N
U11 1489 SN75189 Mouser 595-SN75189AN

CR1 1N914 Mouser 512-1N914

Q1 transistor 2N2907 T0-18 Mouser 494-2N2907A
Q2 transistor 2N2222 TO-18 Mouser 494-2N2222A

C1, C6, C8, C10, C12 tantalium 10 uF 25V Mouser TAP106K050CCS or
https://electronicparts-outlet.com/nl/tantaal-condensatoren-3-35v.html 10 uF 35V (exact size and color)
C7, C9, C11, C13 ceramic disc 10nF Mouser 75-562R5HKS10 (may be a little too big)
C2 10 pF Mouser 598-CD15CD100JO3F
C4 100nF Mouser 871-B32529C1104K000

R1, R2, R3, R4, R7, R12 3K3 1/4 W
R6, 10K 1/4 W
R8, R17 5K6 1/4 W
R14 1K 1/4 W
R16 4K7 1/4 W

R9 180 1/2 W
R10 270 1/2 W
R11 220 1/2 W

R5 Potentiometer 50K Mouser 531-PTC10V-50K or Mouser 652-3339P-1-503LF

J1 2×20 pin connector Double row MALE 2.54MM PITCH Right Angle PIN Header connector 2×20
J2 2×20 pin connector Double row MALE 2.54MM PITCH Right Angle PIN Header connector 2×20

7x IC socket 14 pin
4x IC socket 18 pin

Optional but recommended:
520-ECS-10-13-1XH Crystal HC49U 1 MHz (the large Quartz crystal 1.0 MHz HC6/U is very rare)

New versions of KIM-1 Simulator V2.0.0 and TIM Simulator V0.9

The KIM-1 Simulator has seen a large update.
A new piece of hardware is added, the SD Card/RTC Shield by Corsham Technology.
This addition has been written by Eduardo Casino. Lots of code contributed, thanks Eduardo!
He also added support for two operating systems using the SD Shield, xKIM by Bob Applegate and CP/M-65 by David Given.

The problem with local language keyboard layouts is solved by Eduardo. Now the host operating system takes care of the different layout.

The documentation has been enhanced and moved from a local limited html file to an online version.

Enjoy! See it here.

The keyboard and online improvements have been ported by me to the TIM/Jolt Simulator.

Download it here.

CP/M-65 on the SD Card/RTC Shield

CP/M-65

CP/M-65 is a native port of Digital Research’s seminal 1977 operating system CP/M to the 6502.
Developed by David Given. Ported to many 6502 systems, see the original github archive.

Currently you can cross-assemble programs from a PC, as well as a working C toolchain with llvm-mos. For native development, there’s a basic assembler, a couple of editors, a BASIC, and a byte-compiled Pascal subset and interpreter.

Eduardo Casino ported CP/M-65 to the KIM-1 with an MTU K-1013 FDC, directly connected SD card module, the 1541 drive or Corsham Technology SD CARD/RTC Shield.
And now Eduardo has ported a version special to the KIM-1 Simulator with SD Card/RTC Shield simulation. See his fork of CP/M-65 on his github archive. Several branches are available, development versions with a.o. the KIM-1 Simulator version.
The main changes are to support the KIM-1 Simulator character I/O, using the ACIA simulation instead of low level KIM-1, for non-blocking character input.

How to start CP/M-65

To start using the SD Card/RTC Shield go to the menu settings.

  1. Enable Corsham SDShield emulation
  2. Copy the folder from the KIM-1 Simulator setup distribution archive called SDCARD to your disk.
  3. Choose the Disk images directory pointing to the folder SDCARD. You will see the files on Disk 0 etc filled in, DSK files are for operating systems like CP-M/65
  4. Make sure the first disk mounted is CPM-BOOT.DSK. The DSK files are in the SDCARD folder.

Now you start CP/M-65.

  1. Load the file bootshield.pap into memory with File – Load file in Memory – papertape.
    The file is in the SDCARD folder.

  2. Start the console by pressing the TTY Console button on the main window
  3. Start the Simulator by pressing Run/Stop button
  4. Start CP/M with
    0200 G
    and see the CP/M-65 prompt.
    Note that this boot program gets overwritten by CP/M-65, so you have to load it again after a reset.

Alternative boot program
In the SDCARD folder you find a second boot program called bootsdshield-kimrom.bin
This one can be placed in the unused 6530-003 ROM area, the same idea as Wozmon for the KIM-1.
The advantage is that this is not overwritten by CP/M-65,
Load at $1AA0, start at $1AA0.

Working with disks

The disks, stored in files with type .DSK are in the SDCARD folder. You can mount/dismount/create disks from the Settings screen.
You can have as many as four.

On the Settings screen the disks mounts are shown. Click on the name of a mounted disk or an empy Mount, to go to the Mount Disk dialog. Mount/Dismount here, in Write or read Only mode.

Press the the three … next to the field Image file to select or create a disk image.

Press New and you get the New diskimage dialog.

There is also the IMU utility in CP/M-65 to work with disks from within CP/M-65: mount/unmount, list the directory of the SDCARD folder. create/delete and copy.

Example session

KIM                                                   
0200 D8                                               
KIM                                                   
0200 D8 G                                             
                                                      
CP/M-65 for the KIM-1                                 
                                                      
A>dir                                                 
A: SCRVT100 COM : IMU      COM                        
A: IMU      TXT : SYS      COM                        
A: PASC     PAS : ASM      TXT                        
A: HELLO    ASM : DEMO     SUB                        
A: ASM      COM : ATTR     COM                        
A: BEDIT    COM : CAPSDRV  COM                        
A: COPY     COM : CPUINFO  COM                        
A: DEVICES  COM : DINFO    COM                        
A: DUMP     COM : LS       COM                        
A: STAT     COM : SUBMIT   COM                        
A: MORE     COM : BEDIT    ASM                        
A: BEDIT    TXT : DUMP     ASM                        
A: LS       ASM : CPM65    INC                        
A: DRIVERS  INC : ATBASIC  COM                        
A: ATBASIC  TXT : OBJDUMP  COM                        
A: MKFS     COM : ADM3ADRV COM                        
A: ADM3ATST COM : CLS      COM                        
A: LIFE     COM : QE       COM                        
A: SCRNTEST COM : VT52DRV  COM                        
A: VT52TEST COM : KBDTEST  COM                        
A: MBROT    COM : DS       COM                        
A: DS       TXT : PINT     COM                        
A: PASC     OBB : PLOAD    COM                        
A: HELLO    PAS : IMU3     TXT                        
A: HELLO    SYM                                       
                                                      
A>pint PASC.OBB PASC.PAS PASC.OBS                     
Pascal-M interpreter for CP/M-65: B66F bytes free     
Pascal-M compiler V2k1 for CP/M-65                    
Processing: writeerr                                  
Processing: beginlin                                  
Processing: endline                                   
Processing: error                                     
Processing: stringsi                                  
Processing: nextchar                                  
Processing: insymbol                                  
Processing: enterid                                   
Processing: searchse                                  
Processing: searchid                                  
Processing: getbound                                  
Processing: hexout                                    
Processing: writeout                                  
Processing: bytegen                                   
Processing: wordgen                                   
Processing: genujpen                                  
Processing: plantwor                                  
Processing: skip                                      
Processing: test1                                     
Processing: test2                                     
Processing: intest                                    
Processing: constant                                  
Processing: comptype                                  
Processing: isstring                                  
Processing: simplety                                  
Processing: fieldlis                                  
Processing: typ                                       
Processing: constdec                                  
Processing: typedecl                                  
Processing: vardecla                                  
Processing: paramete                                  
Processing: procdecl                                  
Processing: ldcigen                                   
Processing: ldagen                                    
Processing: lodgen                                    
Processing: condgen                                   
Processing: loadsetc                                  
Processing: cspgen                                    
Processing: incgen                                    
Processing: load                                      
Processing: store                                     
Processing: loadaddr                                  
Processing: falsejum                                  
Processing: calluser                                  
Processing: selector                                  
Processing: variable                                  
Processing: processt                                  
Processing: readproc                                  
Processing: processt                                  
Processing: writepro                                  
Processing: newstate                                  
Processing: releases                                  
Processing: resetrew                                  
Processing: closepro                                  
Processing: assignpr                                  
Processing: getcomma                                  
Processing: ordfunc                                   
Processing: succfunc                                  
Processing: predfunc                                  
Processing: chrfunc                                   
Processing: oddfunc                                   
Processing: eofeolns                                  
Processing: callnons                                  
Processing: call                                      
Processing: opgen                                     
Processing: setexpre                                  
Processing: factor                                    
Processing: term                                      
Processing: simpleex                                  
Processing: expressi                                  
Processing: assignme                                  
Processing: compound                                  
Processing: ifstatem                                  
Processing: casestat                                  
Processing: repeatst                                  
Processing: whilesta                                  
Processing: forstate                                  
Processing: statemen                                  
Processing: body                                      
Processing: block                                     
Processing: stdnames                                  
Processing: enterstd                                  
Processing: enterstn                                  
Processing: enterund                                  
Processing: initiali                                  
Processing: compileh                                  
Processing: compilep                                  
Processing: skipspac                                  
Processing: getword                                   
Processing: findend                                   
Processing: openfile                                  
Processing: closefil                                  
Processing: dumperro                                  
Processing: cpascalm                                  
Compilation successful.                               
No compilation errors PASC.PAS                        
                                                      
A>pload PASC.OBS PASC.OBB                             
Opening input file...                                 
Opening output file...                                
Reading OBP...                                        
Seen 94 procedures                                    
Writing output file...                                
Closing output file...                                
Success.                                              
A>type HELLO.PAS                                      
program HelloWorld;                                   
                                                      
begin                                                 
    writeln('Hello from Pascal!')                     
end.                                                  
                                                      
A>                                                    
A>pint PASC.OBB HELLO.PAS HELLO.OBS                   
Pascal-M interpreter for CP/M-65: B66F bytes free     
Pascal-M compiler V2k1 for CP/M-65                    
Processing: hellowor                                  
Compilation successful.                               
No compilation errors HELLO.PAS                       
                                                      
B>A:pload A:HELLO.OBS HELLO.OBB                       
Opening input file...                                 
Opening output file...                                
Reading OBP...                                        
Seen 1 procedures                                     
Writing output file...                                
Closing output file...                                
Success.                                              
B>A:pint HELLO.OBB                                    
Pascal-M interpreter for CP/M-65: B66F bytes free     
Hello from Pascal!                                    
                                                      
B>                                                    

TIM Simulator documentation

Contents

Introduction

The Jolt/Superjolt/TIM simulator is written for my personal use to aid me in developing and testing software for the TIM/Jolt/Superjolt. It is not meant to be a cycle exact complete emulation. Instead it shows as much as possible what is happening inside.
Just for fun and a tribute, it looks and feels and functions as a real Jolt or Superjolt. The debugger is what the purpose of this program is. The program is developed on Windows 11 and tested and compiled on Ubuntu, macOS and Raspberry Pi. Since source is available, it will run anywhere Lazarus IDE is available.

What is simulated looks like a Jolt or Super Jolt or any TIM based computer connected to a videoterminal.

  • 6502 or 65C02 CPU (only documented behavior)
  • TTY in and out with serial video console or via a serial port
  • 6530-004 RRIOT
  • A PIA 6821 (not implemented yet)

Limitations

What the TIM Simulator does not do as the real TIM/Superjolt:

  • The CPU runs as fast the host CPU allows, and lets the host operating system do some work like key and display and other applications running and continue the emulation loop until the user stops the 6502 CPU.
    The speed is herefore dependent on the host CPU. Running the classic Clock program, showing a HHMMSS clock on the LEDs, on my Intel core I7 one minute real time has the clock show 1 hour 37 minutes.
    The CPU is halted every 1000 clock ticks to let the GUI of the program a chance to handle mouse and keyboard and screen updates like the stop key.
    This works well on modern PCs.
  • The CPU emulation may not be perfect, only valid and documented opcodes are implemented, especially ADC and SBC have many, not emulated here, undocumented issues.
  • RRIOT emulation does not include the timer

Enhancements

The TIM Simulator is to be a Jolt or Superjolt with:

  • 6502 or 65C02 CPU (make the choice in the Debugger)
  • RAM to $6000
  • 6530-044 TIM RRIOT
  • ACIA 6850 at $FE00
  • ROM at $F000 with ACIA routines
  • Reset, NMI and IRQ buttons
  • Tiny Basic and Resident Assembler ROMs

To do, planned expansions

Version 0.1 – 0.9 are beta, only the basic TIM ROM is tested.

  • Testing and bugfixing
  • Better documentation …
  • Add the PIA. The display is already on the main window, but it is not functional
  • Add the HS High Speed reader connected to the A port of the 6530-004

Downloads

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.

Installation

Windows

Run TIMSIMsetup.exe or place the files TIMSIM.EXE file in a folder of choice.
For high DPI screens change the Properties of the TIMSIM.EXE, Compatibility settings,
– Change high DPI settings,
– check high DPI scaling Override,
– scaling performed by “System(enhanced)”.

Ubuntu or Raspberry 5 64 bit

Execute TIMSIM from the Ubuntu or Raspberry Pi folder in the setup archive.

Note that the font used is Courier New. Install ttf cour.ttf on Linux in .home/.fonts to prevent substitution with artifacts

macOS

  • Unzip the file
  • Move the TIMSIM app to Applications
  • Remove quarantine:
    $ xattr -dr com.apple.quarantine /Applications/TIMSIM.app
  • Other platforms
    Install Lazarus (Version 2 or higher) and build from source.
    You need the Lazserial package from the Package Manager.
    No extra packages are required, just standard Lazarus.
    Open the project TIMSIM.LPI and do RUN – Build to get an executable.

    After installation
    Start the TIM Simulator and choose Settings to
    – set the default working directory. Otherwise files may appear at locations you do not want!
    – Choose between serial or console

    How to use as Jolt/Superjolt

    Start the emulator main program and push the ‘Reset/Stop’ icon.

    The Console window is the default input/output device for TIMSIM.

    Run/stop will display the TIM prompt ‘.’

    Default working directory and other settings

    Use the menu Settings to display 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.

    Default settings config file : “/home/(user)/.config/TIMSIM.cfg” or C:\users\(user)\Appdata\local\TIMSIM.cfg”
    Loaded at startup, updated via the Settings menu.

    Load and Save

    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 and Motorola S-Records 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
    

    a name=”console”>

    TTY console mode

    The TTY console switch lets the TIM simulator use a glass teletype in a console window. The standard TIM user interface is shown, see the manual how to use.
    The Console is an emulation video terminal (ANSI color, subset) connected to an ACIA (a Motorola 6850) in the TIM. The TIM Monitor is patched to send or receive via the ACIA and is transparant to the user of the TIM I/O routines (even the quirks like flags and returned register values!)
    Note: set the PC keyboard to CAPS Lock, only uppercase is used in the TIM 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.

    Keyboard input, when the console window has focus, is sent to the serial input of the ACIA. No local echo. The TIM 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.

    Received characters by the console are handled as follows, a subset of the ANSI/VT100 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 (overstrike, no room for 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 
    

    Serial or Console

    The TIM Simulator comes with a ‘console’, a glass teletype 24×80 screen. It has a subset of ANSI/VT100 support.

    Of course there are much better terminal emulators, like Teraterm, Putty, Coolterm, Minicom etcetera.
    And a real VT100 type device is really fun! Or a real Teletype …

    Now the Simulator can use either an external serial device,e.g a PC with Teraterm or Minicom, or a terminal emulator locally on the same PC.

    The Simulator starts up as usual, with the console window open.

    When yo go to the menu Settings you can setup the serial port to use instead of the console for input and output to the Jolt.

    When you next select Use Serial Port, the console window disappears.

    Now activate a serial terminal. Extern via the physical serial port (USB etc) or a local one like Teraterm. Make sure the settings are the same as in the Simulator. 9600 baud, 8 bits, no flow control will do fine.

    Start the Simulator and the TIM prompt will show on your serial device.

    Windows
    Install the com0com null-modem emulator from here.
    That delivers two COM ports that act as if they are connected via a null modem, anything entered at one is sent to the other and vice versa.

    Use a terminal emulator as Teraterm with a serial connection to the other COM port. with the same settings for serial as in the Simulator!
    Then select in Settings – Use serial and start the emulator.
    Note TIM only works with uppercase characters.

    Linux

    Use this commmand (install socat if not present).

    socat -d -d pty pty
    The code above returns (the pts numbers may be different).

    2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/2
    2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/3
    2013/11/01 13:47:27 socat[2506] N starting data transfer loop with FDs [3,3] and [5,5]
    Any character entered at one is sent to the other pts device as if a null modem cable is connected.

    Use the device /dev/pts/2 in the TIM Simulator Settings – Setup serial. Default is 9600.
    Start a terminal emulator like minicom or Coolterm and select device /dev/pts/3 at 9600 baud.

    Select in Settings – Use serial port /dev/pts/3 and start the terminal emulator.
    Now you can control the TIM via minicom or any suitable VT100 like terminal emulator.
    Select in Settings – Use serial and start the emulator

    Minicom is easy to use. Just set the terminal serial port (the other than the emulator uses).

    Coolterm is tested, but is a little bit troublesome to configure.
    Force the serial port via Custom and ignore the warning messages.

    The debugger

    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.

    Single step, RUN, trace log

    First set the PC to the first instruction of the program to test.

    • Step in: execute next instruction
    • Step over: execute next instruction but skip JSR subroutines
    • RUN: execute at maximum speed ( wait 0) or slow (wait x seconds between steps), use the STOP button to halt execution
    • Step n: execute n instructions full speed
    • Run to: execute instructions full instructions until the breakpoint or watchpoint location is reached or STOP pressed
    • You can set 10 code breakpoints, 10 memory watch points and wacthpoints on registers A,X,, Y and Stackpointer, press the Breakpoints and Watches button to show the form to fill in as desired.
    • Trace log on/off: first set the Trace log file directory from the file Menu, then use any Step to have every instruction logged with status in the logfile and the tracelog.Note that this slows down execution a lot and the files can become large. So clean up regularly!
      The file name of the log is set to TIMSIMtrace(datestamp).log.

    Search

    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.

Symbol table and the disassembler

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).

The Profiler

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’.

Compiling and building the simulator from source

Prerequisites

  • A modern PC and operating system. Windows 10/11 is where the software has been developed, R Ubuntu has been tested.
  • Development (Compile and run everywhere!) with Freepascal and Lazarus IDE, see https://www.lazarus-ide.org/
    Any Lazarus version above 2.0 will be OK.
  • The archive with the TIM Simulator sources TIMSIMs09.zip (or higher version).
  • Unpack in a folder, avoid blanks in folder and filenames
  • Start the IDE by clicking on TIMSIM.lpi
  • Build with Run – Build
  • On Windows a Setup installable can be made with Inno Setup, TIMSIM.iss and compile with Inno Studio.

Note that the font used is Courier New. Install ttf cour.ttf on Linux in .home/pi/.fonts to prevent substitution with artefacts

The include files with TIM ROM and 6502 code

If and when the ACIA routines and other routines in the TIMSIM ROM are altered you need to rebuild the TIMSIMrom.inc file.
Subfolder ‘romtoconst’ contains the binary of the original TIM ROMS (TIM.bin) and the additional ROM binary with ACIA routines (timsimrom.bin).
The .inc files for the compilation of the TIMSIM, 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 TIMSIM program again.
Tiny Basic and RAP are in joltsw.bin

D:\myfiles\development\TIM simulator\romtoconst\creatINC.exe
timsimrom.inc include file created
timrom.inc include file created
joltsw.inc include file created

Folder TIM assembler sources

with command to create intel hex file

"D:\myfiles\development\TIM simulator\TIM assembler sources\tasm" -65 -x3 -g0 -s $(FILE_NAME) $(NAME_PART).ihex  $(NAME_PART).lst  -s $(NAME_PART).sym

or to create a binary file with

"D:\myfiles\development\TIM simulator\TIM assembler sources\tasm" -65 -x3 -g3 -s $(FILE_NAME) $(NAME_PART).bin  $(NAME_PART).lst  -s $(NAME_PART).sym

Note that also symbol files are generated which can be read in by the debugger in the TIM Simulator.

Changelog

  • V 0.1 21 November 2023 First public beta
  • V 0.2 22 November 2023 File load/save menu repaired
  • V0.3 26 november 2023 Tiny Basic runs, console limited to ASCII to $7E, bit 8 masked off
    Break condition now always false (Tiny Basic spits out rubbish) Backported to KIM-1 Simulator.

  • V 0.4 1 December 2023 Tiny Basic corrected in ROM, TIM ROM corrected for LH ; error, forms now on taskbar Windows
  • V 0.5 File types shown in load/save, bugfixes, setup with logo
  • V 0.6 Console improvements
  • v0.7 November 2024 Support ACIA ROM moved to F800.
    Can now load KIM-5 Resident Asembler/Editor
  • 0.8 Serial input/output added
  • 0.9 Online help and general local keyboard support
post

MTU K-1008 Visible Memory

The MTU Visible Memory is a memory mapped video display made by MTU. Supported by the KIM-1 Simulator.

See the MTU K-1008 pages 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.

Screenshot of 1.3.3 with ‘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:

  • Load a K-1008 formatted binary file into memory. It will show on the K-1008 display if enabled via Settings.
  • The Refresh button in the debugger will also refresh the K-10008 display from memory
  • With a C header file. see below

How to make a C Header image file with threshold

  1. Choose a high contrast image
  2. Load the image in GIMP (a freeware image processing app for Windows, Linux etc)
  3. Scale the image to 320×200 exactly(have the ties between the dimension windows untied)
  4. Use the Treshold tool to convert to black and white, play with the settings until it looks good
  5. Export to, choose the C header file format, a file
  6. This file can be loaded with the File menu entries of the KIM- Simulator main window and Debugger
  7. The file is converted if you load in it into memory
  8. If you have the K-1008 display on (see Settings) it will display it too
  9. Now you can save the image if you wish with the ‘Memory to file’ menu entries

Make a C Header image file with dithered images

  1. Open image in GIMP
  2. Crop the image to 320×200 or a multiple like 960×600
  3. Image – Scale the image to 320×200
  4. Image – Mode – Indexed to black white palette Floyd-Steinberg (normal)
  5. Image – Mode – RGB
  6. File -Export As Select file type – C source header
  7. Export

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:

  1. Load an image in GIMP
  2. Scale to 320×200 (detach the link between the sizes)
  3. Threshold or dither to black and white, play to get a nice result
  4. Export as C header file
  5. Feed the C header file to this program
  6. Convert the result, a binary file into a program like my Convert 8 bit hex formats (included with the KIM-1 Simulator) to a papertape format with the start address of the K-1008 (2000-C000)
  7. Load the papertape into the KIM-1 or KIM-1 Simulator

Also there are examples of C header and binary K-1008 formatted files.

Sources of LoadK1008 commandline

The folder K-1008 load C Header contains the Freepascal source and original JPG files.

post

TTY Serial

TTY Serial

The KIM-1 Simulator comes with a ‘console’, a glass teletype 24×80 screen. It has a subset of ANSI/VT100 support.
Of course there are much better terminal emulators, like Teraterm, Putty, Coolterm, Minicom etcetera.

And a real VT100 type device is really fun! Or a real Teletype …
Now the KIM-1 Simulator can use either an external serial device, e.g a PC with Teraterm or Minicom, or a terminal emulator locally on the same PC.

Activate serial input/output local on your PC as follows:

  • Start your external terminal emulator, e,g, Teraterm or Minicom with serial port settings 9600 baud.
  • Choose the desired serial port, See below for Windows or Linux null modem setup
  • Start the KIM-1 Simulator
  • Activate TTY Console, the Console window appears
  • Choose Settings – Setup serial port
  • set for 9600 baud
  • Choose the desired serial port, the OTHER in the null modem setup
  • Press the Use serial button, the console window disappears
  • Start the Simulator from the main Window with Run/Stop
  • Now the serial terminal emulator shows the KIM prompt
  • Note the Simulator is not very forgiving if you make a mistake with serial ports in this first version, Close the Simulator application and start over.

Windows
Install the com0com null-modem emulator from here.
That delivers two COM ports that act as if they are connected via a null modem, anything entered at one is sent to the other and vice versa.See the device manager for the ports created.

Use a terminal emulator as Teraterm with a serial connection to the other COM port. With the same settings for serial as in the Simulator!
Then select in Settings – Use serial and start the emulator.
Note the KIM-1 only works with uppercase characters.

Linux

Use this commmand (install socat if not present).

socat -d -d pty pty

The code above returns (the pts numbers may be different).

2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/2
2013/11/01 13:47:27 socat[2506] N PTY is /dev/pts/3
2013/11/01 13:47:27 socat[2506] N starting data transfer loop with FDs [3,3] and [5,5]

Any character entered at one is sent to the other pts device as if a null modem cable is connected.

Use the device /dev/pts/2 in the KIM-1 Simulator Settings – Setup serial. Default is 9600.
Start a terminal emulator like minicom or Coolterm and select device /dev/pts/3 at 9600 baud.
Select in Settings – Use serial port /dev/pts/3 and start the terminal emulator.
Now you can control the TIM via minicom or any suitable VT100 like terminal emulator.
Select in Settings – Use serial and start the emulator

Minicom is easy to use. Just set the terminal serial port (the other than the emulator uses).

Coolterm is tested, but is a little bit troublesome to configure.
Force the serial port via Custom and ignore the warning messages.