• Stars
    star
    320
  • Rank 131,126 (Top 3 %)
  • Language
    Assembly
  • Created almost 10 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Microsoft BASIC for 6502 (Commodore, Apple, KIM-1, AIM-65, OSI, ...)

Microsoft BASIC for 6502

This is a single integrated assembly source tree that can generate nine different versions of Microsoft BASIC for 6502.

By running ./make.sh, this will generate all versions and compare them to the original files byte by byte. The CC65 compiler suite is need to build this project.

These are the first ten (known) versions of Microsoft BASIC for 6502:

Name Release MS Version ROM 9digit INPUTBUFFER extensions .define
Commodore BASIC 1 1977 Y Y ZP CBM
OSI BASIC 1977 1.0 REV 3.2 Y N ZP - CONFIG_10A
AppleSoft I 1977 1.1 N Y $0200 Apple CONFIG_11
KIM BASIC 1977 1.1 N Y ZP - CONFIG_11A
AppleSoft II 1978 Y Y $0200 Apple CONFIG_2
AIM-65 BASIC 1978 1.1? Y N ZP AIM CONFIG_2A
SYM-1 BASIC 1978 1.1? Y N ZP SYM CONFIG_2A
Commodore BASIC 2 1979 Y Y $0200 CBM CONFIG_2A
KBD BASIC 1982 Y N $0700 KBD CONFIG_2B
MicroTAN 1980 Y Y ZP - CONFIG_2C

(Note that this assembly source cannot (yet) build AppleSoft II.)

This lists the versions in the order in which they were forked from the Microsoft source base. Commodore BASIC 1, as used on the original PET is the oldest known version of Microsoft BASIC for 6502. It contains some additions to Microsoft's version, like Commodore-style file I/O.

The CONFIG_n defines specify what Microsoft-version the OEM version is based on. If CONFIG_2B is defined, for example, CONFIG_2A, CONFIG_2, CONFIG_11A, CONFIG_11 and CONFIG_10A will be defined as well, and all bugfixes up to version 2B will be enabled.

The following symbols can be defined in addition:

Configuration Symbol Description
CONFIG_CBM1_PATCHES jump out into CBM1's binary patches instead of doing the right thing inline
CONFIG_CBM_ALL add all Commodore-specific additions except file I/O
CONFIG_DATAFLG ?
CONFIG_EASTER_EGG include the CBM2 "WAIT 6502" easter egg
CONFIG_FILE support Commodore PRINT#, INPUT#, GET#, CMD
CONFIG_IO_MSB all I/O has bit #7 set
CONFIG_MONCOUT_DESTROYS_Y Y needs to be preserved when calling MONCOUT
CONFIG_NO_CR terminal doesn't need explicit CRs on line ends
CONFIG_NO_LINE_EDITING disable support for Microsoft-style "@", "_", BEL etc.
CONFIG_NO_POKE don't support PEEK, POKE and WAIT
CONFIG_NO_READ_Y_IS_ZERO_HACK don't do a very volatile trick that saves one byte
CONFIG_NULL support for the NULL statement
CONFIG_PEEK_SAVE_LINNUM preserve LINNUM on a PEEK
CONFIG_PRINTNULLS whether PRINTNULLS does anything
CONFIG_PRINT_CR print CR when line end reached
CONFIG_RAM optimizations for RAM version of BASIC, only use on 1.x
CONFIG_ROR_WORKAROUND use workaround for buggy 6502s from 1975/1976; not safe for CONFIG_SMALL!
CONFIG_SAFE_NAMENOTFOUND check both bytes of the caller's address in NAMENOTFOUND
CONFIG_SCRTCH_ORDER where in the init code to call SCRTCH
CONFIG_SMALL use 6 digit FP instead of 9 digit, use 2 character error messages, don't have GET
CONFIG_SMALL_ERROR use 2 character error messages

Changing symbol definitions can alter an existing base configuration, but it not guaranteed to assemble or work correctly.

More Information

More information on the differences of the respective versions can be found on this blog entry: Create your own Version of Microsoft BASIC for 6502.

License

2-clause BSD

Credits

  • Main work by Michael Steil [email protected].
  • AIM-65 and SYM-1 by Martin Hoffmann-Vetter
  • Function names and all uppercase comments taken from Bob Sander-Cederlof's excellent AppleSoft II disassembly.
  • Applesoft lite by Tom Greene helped a lot, too.
  • Thanks to Joe Zbicak for help with Intellision Keyboard BASIC
  • This work is dedicated to the memory of my dear hacking pal Michael "acidity" Kollmann.

More Repositories

1

c64ref

Ultimate Commodore 64 Reference: ROM Disassembly, Memory Map, ...
Python
454
star
2

hvdos

hvdos, a simple DOS emulator based on the OS X Hypervisor.framework
C
442
star
3

cbmsrc

Original source code of various Commodore computers and peripherals.
Roff
435
star
4

cbmbasic

cbmbasic, a portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64
C
434
star
5

geos

Source code of GEOS 2.0 for the Commodore 64 and 128
Assembly
400
star
6

perfect6502

perfect6502, a MOS 6502 CPU emulator that performs a simulation of the original NMOS 6502 netlist
C
294
star
7

c64rom

Commodore 64 BASIC and KERNAL Source
Assembly
194
star
8

msdos1

A collection of disassembled and commented source of parts of MS-DOS 1.0
Assembly
182
star
9

visualize_1541

A tool that creates visualizations of the data layout on Commodore 1541 disk images
Python
69
star
10

64er-magazin.de

HTML
68
star
11

80columns

80x25 text mode for the Commodore 64 BASIC/KERNAL environment
Assembly
65
star
12

ccgmsterm

CCGMS Future, a terminal program for the Commodore 64
Assembly
64
star
13

pucrunch

pucrunch, an Optimizing Hybrid LZ77 RLE Data Compression Program for C64/C128/VIC-20/Plus4
C
56
star
14

geowrite

Source code of geoWrite 2.1 for the Commodore 64
Assembly
55
star
15

final_cartridge

Assembly
53
star
16

ctools

ctools, programs for accessing C64 and C128 CP/M disk images (*.D64).
C++
48
star
17

kernalemu

Commodore KERNAL emulator, to run C64/C128 etc. command line applications on UNIX
C
40
star
18

fc3-geos

Final Cartridge III with GEOS
Assembly
33
star
19

extract-adf

extract-adf, a tool that extracts files from (broken) Amiga OFS ADF/ADZ/DMS disk images
C
30
star
20

c64_kernal

Assembly
29
star
21

cbm6502asm

Commodore 6502ASM, the original 6502/65C02/65CE02 Assembler used by Commodore for C65 project
C
28
star
22

cbmbus_doc

HTML
26
star
23

fastboot1541

fastboot1541, an autostart fastloader for the Commodore 64 and 1541 that fits into a single sector.
Assembly
26
star
24

dos1541

The Commodore 1541 DOS ROM, buildable with cc65
Assembly
24
star
25

mxass

mxass, a cross assembler that targets Commodore 64-like platforms (6502/65816/Z80)
Assembly
23
star
26

TopDesk

The TopDesk file manager for the C64/C128 GEOS operating system
Assembly
22
star
27

thewave

The Wave Web Browser for C64/C128 GEOS Wheels
Assembly
19
star
28

datasette_load

A minimal Commodore 64 Datasette program loader
Assembly
16
star
29

nes_snes_controller_6502

NES & SNES Controller Driver for 6502 (Commodore 64)
Assembly
16
star
30

c64bs

C64 KERNAL patch to support ACIA hardware serial, parallel IEEE-488 and more
Assembly
15
star
31

defrag1541

A visual Commodore 64/1541 disk defragmentation program
Visual Basic
15
star
32

ted_kernal

The Commodore TED (C16, C116, Plus/4) KERNAL, buildable with cc65
Assembly
14
star
33

geowrite2rtf

geowrite2txt, a simple tool to convert C64/C128 GEOS GeoWrite documents into plain text
C
14
star
34

static6502

Roff
11
star
35

cbmfs

cbmfs, a Commodore 1541 file system driver for MacFUSE
C
10
star
36

ultimatetron2

Ultimate Tron II is a game for the Commodore 64
Assembly
9
star
37

vis2ascii

vis2ascii, a tool to convert VisAss/F8 AssBlaster C64 assembly into ASCII
C
9
star
38

combine_d64

combine_d64 D64 File Reconstruction Tool
Python
9
star
39

anatomy-4040

Reconstruction of the book "Anatomy of the 4040 Disk Drive" (1988) by Hilaire Gagne from the original files
HTML
8
star
40

extract-md

extract-md, a tool to extract text and graphics from disk images of issues of the German Commodore 64 disk magazine "Magic Disk 64"
C
5
star
41

ps2keyboard

Assembly
4
star
42

darmok

darmok.com: Memes in the Tamarian language
Shell
3
star