Skip to content
6502 Forth-83 dialect for the Commodore PET 2001
Forth Makefile
Branch: master
Clone or download
Latest commit 56535b8 Aug 12, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vs changed MOTD, fixed dosbuild.bat Aug 25, 2016
core/src ... Nov 25, 2018
data ... Aug 12, 2019
docs ... Aug 12, 2019
studio/src update editor help Nov 26, 2018
tapes ... Nov 5, 2018
test ... Nov 8, 2017
tools ... Oct 17, 2018
.gitattributes ... Nov 10, 2017
.gitignore ... Jun 5, 2018
Makefile create works Aug 7, 2019
README removed link to old website May 15, 2019
chitselb.d64 update editor help Nov 26, 2018
chitselb.xpet.v32 ... Aug 13, 2018
fastgraphics.a65 from daal Jun 3, 2018
foobird ... Aug 30, 2018
murdlok_de.d64 ... Nov 18, 2018
murdlok_en.d64 ... Nov 18, 2018
pettil.d64 ... Aug 12, 2019
pettil.dbg ... Nov 24, 2018
pettil.prg ... Aug 12, 2019
pettil.sublime-project ... Sep 5, 2018
pettil.sublime-workspace ... Nov 5, 2018
sdk2keysb.txt ... Aug 11, 2018
testsetup.txt added 'bye' Sep 26, 2018


2019-05-05 *** UPDATE *** UPDATE *** UPDATE *** UPDATE *** UPDATE *** UPDATE ***

PETTIL needs help!  I need some people with actual management/engineering skills to help me break through to the next level.

Right now it's at a point where I can do good demos of most of it using smoke and mirrors to hide the problems. shows how that looks.  
(the music is my cousin's band)

If you want to try this and aren't sure you have the chops, but want to know more Forth and Assembler, then
you're exactly the person I'm looking for.  Please email 

Objectives for this code drive:  

Catalog and identify several known bugs that I haven't gotten around to yet

Create releases for:    80-column PET    Upgrade ROM PET    VIC-20    C=64    C128    Plus/4
  stretch goal:  Apple  Atari OSI

Create `PERTURBO`(tm) VICE test automation system for above releases
  (PETTIL's Enthusiastic Regression Testing Usually Reduces Bad Outcomes)
  How to make VICE power off the machine:

Review & Clean up documentation

Here's the toolstack I'm using today:
Ubuntu Linux 17.04, bash shell
Sublime Text 3
VICE xpet

You could do this with any other operating system, editor or PET emulator,
but at the end of the day, the sole requirement is that it be able to run
on my own Commodore PET 2001-N16, s/n 700251, now with 32K, BASIC 4 ROM,
and a few other bits of hardware added.  Notably this limits the storage
media to cassette tape.


The project blog is at
Language tiddlywiki at

Objectives of the project are, in no particular order:
* make a Forth that runs on my Commodore PET 2001
* have fun
* improve my "6502 assembly golf" skills
* find other people who are interested in this project

Future directions
* have a "Forth written in Forth" (metacompilation)
* implement a retro videogame
* add support for more storage devices
* port PETTIL to other 6502-based computers
** PETTIL-64
** PETTIL-128
** Apple-PETTIL

More in the Forth and Programming forums at
Also a few good threads (search for 'chitselb') on comp.lang.forth
There is a Facebook page at

There is no linker or relocation loader.  `pettil.prg` is a simple
concatenation of three build artifacts:

`pettil.prg` = `pettil-core.obj` + `pettil-studio.obj` + `pettil.sym`

`pettil-core` $0400-$1BFF is the base language runtime, under 6K.
* barebones PETTIL, under 6K.
* Standalone applications (no developer tools) can run with *only* this
* arithmetic, boolean and relational operators
* stack and memory manipulation
* virtual memory support
* inner interpreter
* Sweet-16

`pettil-studio` $6C00-$7FFF (the transient dictionary) contains words
required for development but not for application runtime.  This dictionary
can be released, freeing up the entire 25K of RAM (on a 32K PET) above
`pettil-core` for applications
* outer interpreter
* defining words
* compiler
* assembler
* editor

`pettil-sym` $5C00-$6BFF combined symbol table for both dictionaries

To build PETTIL, clone this repository, install xa65, ruby and VICE.  Try
these commands to see if your build environment will (probably) work.  These
are the version numbers as of the time I'm editing this document, they do
not really matter.  Trickier is getting the emulator settings perfect.

$ grep DESCRIPT /etc/*release
/etc/lsb-release:DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

$ git --version
git version 2.7.4

$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

$ xa --version
xa (xa65) v2.3.5

$ xpet
[Help] [About VICE...]
xpet 3.0 (GTK+ AMD64/x86_64 Linux glibc 2.23 GCC-5.4.0)
Configure it to be a PET 2001-32N, BASIC 4 ROM

$ dpkg -l make
make 4.1-6 amd64  utility for directing compilation

$ git clone
$ cd pettil/
pettil$ make

(does a build and launches an xpet running PETTIL)

Please email
with any suggestions for improving the documentation.  I want my mom to be
able to understand this and run PETTIL.

You can’t perform that action at this time.