Microsoft Basic for the KIM-1 KB-6

I know KB6 existed. The ‘6’ stands for the precision in digits of the floating point number. In the documentation KB-6 is described.
Never seen a version in the wild. I know KB6 existed. The ‘6’ stands for the precision in digits of the floating point number. In the documentation KB-6 is described. Never seen a version in the wild. So the reconstruction here is not checked with the original, addresses in the reconstruction from the linker differ from the documentation.”>So the reconstruction here is not checked with the original, addresses in the reconstruction from the linker differ from the documentation.

Microsoft Basic for the KIM-1: KB9 update

More information on KB9 and a new faster and smaller version

Microsoft KB-9 Basic

Microsoft Basic for the KIM-1 (KB-9)

On this page you will find:


KB-9 stands for Microsoft Basic V1.1 for the KIM-1  with 9 digits precision. Actually, when you run it, it is called MOS Tech 6502 Basic v1.1 Copyright 1977 by Microsoft Co.
The ‘9’ stands for 9 digit precision floating point numbers. A KB-6 (6 digits precision) existed, but no copy ever turned up.

Downloads

Scanned manual
The original KIM-1 KB-9 Microsoft Basic V1.1, cassette audio wave, binary and papertape format
How to use, read this! Clear decimal, set vectors!

Resources

Articles on KB9 in the clubmagazine KIM/6502 Kenner:
– KIM Kenner 4 Siep de Vries Evaluatie 8K Basic, test of accuracy of KB-9, Dutch
– KIM Kenner 5 Uwe Schroder, English, Some Basic problems solved
– KIM Kenner 6 S. Woldringh Patches op 8K Basic Load and Save commands
– KIM Kenner 10 p 10 Microsoft Basic, Hans Otten.
– KIM Kenner 11 p 15 S. Woldringh Patches op 8K Basic part 2
– KIM Kenner 11 p 19 W. van Gelderen Read and Write on cassette for 8K Basic
(alternative commented scanned version here)
– KIM Kenner 12 p 15 Patches Microsoft Basic, Hans Otten. Trace mode Renumber
– KIM Kenner 14 p 39 Patches Microsoft Basic, Hans Otten. Calculated line numbers
– 6502 Kenner 16 p 49 Patches Microsoft Basic, W. Blonk Corrections on KIM Kenner 12
– 6502 Kenner 19 p 34 Patches Microsoft Basic, Hans Otten. Speed up Basic 10% with ROR
– 6502 Kenner 22 p 12 Patches Microsoft Basic part 1, van Nieuwenhove Koen, adapt KB-9 to Elektor Junior
– 6502 Kenner 23 p 12 Patches Microsoft Basic part 2, van Nieuwenhove Koen, adapt KB-9 to Elektor Junior
– 6502 Kenner 24 p 14 Patches Microsoft Basic part 3, van Nieuwenhove Koen, adapt KB-9 to Elektor Junior
– 6502 Kenner 25 p 6 Patches Microsoft Basic part 4, van Nieuwenhove Koen, adapt KB-9 to Elektor Junior
– 6502 Kenner 29 p 33 KB-9 Basic on Acorn SYSTEM-1
– 6502 Kenner 32 p 21 W. L. van Pelt KB-9 Basic Tokenized keywords and addresses
Language lab section in the 6502 User Notes:
– Vol 13 Basic tips, Renumber Page 1, Page 2
– Vol 14, Tips, Paging, Autiomatic Line numbers, the GET statement, USR function
Page 1, Page 2, Page 3, Page 4
– Vol 15 USR Dispatch, Load/save Basic arrays Page 1, Page 2, Page 3
-Vol 16 Line Editor Page 1, Page 2, Page 3, Page 4
-Vol 17 IEEE, Save Load cassette
Page 1, Page 2, Page 3, Page 4

Sources of KB-9 Microsoft Basic v1.1

Resources:

source in MAC format

Adapt KB-9, first step make it faster and smaller

In the previous section the pagetable article was shown, with resources to recreate from source many 6502 Basic’s, like KB-9.

Here an example how I, quick and dirty, used this to create a KB-9 named V1.2 which is smaller and faster than the original.

This is how I did it (Windows, can be done also on Linux)

  1. Download and unpack the archive of pagetable in a folder on your PC.
  2. Download and unpack the CC65 package, a C compiler, from which only the assembler and linker is used. I used the Windows binary.
  3. Copy CA65.EXE, LD65.EXE and longbranch.mac from the CC65 package to the folder where you unpacked the MS Basic source.
  4. Change whatever you like in the source. It is quite a complicated construction, with macros for every variant, so look carefully at the listing file what really is produced.
    Start with no adaptations and then go on studying the listing file and testing. The KIM-1 Simulator is a good tool for testing! Load the symbol table file to see what is where.
  5. Assemble and link with this simple batch file makekb9v2.bat, resulting in an object, a binary, a listing file and a symbol label file.
    ca65 -D kb9 msbasic.s -o tmp/kb9v2.o -l tmp/kb9v2.lst
    ld65 -C kb9.cfg tmp/kb9v2.o -o tmp/kb9v2.bin -Ln tmp/kb9v2.lbl
    
  6. Repeat step 4 and 5 until you are satisfied with the adaptations. The article listed above are a good source of inspiration.

First example: use the ROR instruction and suppress nulls sent to the terminal and Clear decimal
I changed this:

    • In define_kim.smake a comment of the following two lines:

 

; CONFIG_NULL := 1                      ; patch HO 2021
;CONFIG_ROR_WORKAROUND := 1             ; patch HO 2021
  • In init.s add this line at label COLD_START
    COLD_START:
    .ifdef SYM1
            jsr     ACCESS
    .endif
    .ifdef KBD
      .
      .
      .
    .else
      .ifndef CBM2
            cld                     ; patch for KIM-1 HO 2021
            ldx     #$FF
            stx     CURLIN+1
    

Assemble and link with the batch file makekb9v2.bat, this will deliver in the folder tmp/
– kb9v2.bin file : load as usual at $2000
– kb9v2.lbl text file
– kb9v2lst textfile

Start KB9 now at location $3F8E, label COLD_START (used to be $4065, so we gained some RAM)

Here is an archive with all files mentioned above.

And here the new KB-9 V1.2 executable, faster (no ROR instruction emulation) and a bit smaller.
You can test all this with the KIM-1 Simulator (version 0.9.3 lets you load CC65 type of symbol files)

KB-6

I know KB-6 existed. The ‘6’ stands for the precision in digits of the floating point number. In the documentation KB-6 is described.
Never seen a version in the wild. So the reconstruction here is not checked with the original, addresses in the reconstruction from the linker differ from the documentation.
Perhaps the ROR workaround or the insertion of CLD in the init.s caused this.

KB-6 it can be ‘reconstructed’ since other versions of 6 digit Microsoft Basic are in the ‘pagetable sources’.
It takes one define added in define_kim.s, changes on the original file are now:

; CONFIG_NULL := 1                      ; patch HO 2021
;CONFIG_ROR_WORKAROUND := 1             ; patch HO 2021
CONFIG_SMALL := 1                       ; patch H0 2021

Assemble and link as above. COLD_START moves to $3DF0, size shrinks to less than 8K.
Binary of KB-6 here.
As you can see in the following screenshots it works! Note the number of digits is less, as to be expected.

Microsoft Basic for the KIM-1 KB-9

Microsoft Basic for the KIM-1 KB-6, less precision, smaller program size

PAL-1 page updated

A lot has happened with the PAL-1, the active developed and available KIM clone.

So an update to the page with all the boards and manuals and modifications that appeared this year!

Microchess and MICRO_ADE sources and binaries

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.

Robert Leedom games

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

Pascal-M 2k1 Pascal on the KIM-1

New version of the Pascal-M system, run Pascal programs on the KIM-1.

Convert hex formats new version

Bug fix release of the PC utility to convert MOS papertape, Intel hex, Motorola S record, Apple 1 hex etc. Windows and Linux. Source included.

HEXPAWN

A game by Robert Leedom, published in 6502 user notes #13, 1979. Typed in by Dominic Bumbaco so we can play it!.