Skip to content
Sweet 16 Ported to the Commodore VIC-20
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
sweet16-vic20.patch
test-sweet16.a65

README.md

sweet16_vic20

A port of Apple's Sweet 16 pseudo machine interpreter, written by Steve Wozniak, over to the Commodore VIC-20. This code creates a 16-bit virtual machine in around 300 bytes. The port is written for the XA assembler.

This patch was written as part of an article: Sweet 16 (The 6502 Dream Machine) Ported to the VIC-20.

The original Sweet 16 source code has been published a number of times including in Byte Magazine Volume 02 Number 11 - November 1977. In this article Steve Wozniak encourages users to modify Sweet 16 and even to port it to other processors, so hopefully he won't mind its being ported to the Vic. However, despite this and the fact that the code is widely available, it is still probably under copyright and therefore the port relies on patching the original source code rather than supplying a complete version.

Patching Sweet 16 Source Code for the VIC-20

The source used for patching is from the article: Porting Sweet 16. Save the Sweet 16 source code from this article, with no blank lines at the top or bottom, in a file called sweet16-original.asm. Then patch it using the following:

patch -o sweet16.a65 -l sweet16-original.a65 sweet16_vic20.patch

You will now have a file called sweet16.a65.

If you are using a different version of the original source code then you will have to manually inspect the patch file to see the changes.

Assembling Test

The test code uses #include to include the ported Sweet 16 code and runs a test of memory copying using the Sweet 16 VM. To assemble the test:

$ xa -o test-sweet16.prg test-sweet16.a65

Now on a VIC-20 load the program:

LOAD "*",8,1
SYS 4744

The screen should show:

TESTING
MEMCPY...PASS
MUL......PASS
NEGATE...PASS

Licence

Original Sweet 16 Source Code

The original Sweet 16 source code retains its original copyright and I make no claim on that, nor do I make any claim on the copyright of the parts changed.

Test Source Code

The test source code is released into the public Domain.

CC0
To the extent possible under law, Lawrence Woodman has waived all copyright and related or neighboring rights to this work.

You can’t perform that action at this time.