AASCAD, Another AppleSoft Compiler And Decompiler, is a reimplementation of TASC 2.01 as one Python script. It compiles an Applesoft program exactly as TASC does, producing the same object file byte for byte, and it turns a TASC object file back into an Applesoft program, which it checks by compiling it again: a decompiled program is reported only if it compiles to the same bytes.
Download aascad.py (253,925 bytes, sha256 167812fe52f76912…)
Needs Python 3.9 or later and nothing else: no packages to install. Reading and writing disk images also needs CiderPress II’s command-line program.
The project’s details, history and tests: project page on GitHub.
compile
aascad compile SOURCE [-o OBJECT] [options]. TASC’s questions become options; leaving one out is the same as answering it with RETURN. Prints the object’s load address, size and SHA-256.
| Option | Meaning |
|---|---|
SOURCE | the Applesoft program: a text listing (numbered lines) or a tokenized program as DOS saves it |
-o OBJECT | the object file to write (default: the source’s name with .OBJ) |
--library ADDR | where RUNTIME is loaded (TASC’s memory usage question; default $0803) |
--program ADDR|HGR1|HGR2 | where the compiled program goes (default: right after the library); HGR1 or HGR2 starts it above that hi-res screen |
--variables ADDR | where the program’s variables go (default: right after the program) |
--no-int-arith | turn off the integer arithmetic option |
--no-int-const | turn off the integer constants option |
--resume | turn on the RESUME/debug code option |
--compare OBJECT | check the result against an existing object file, byte for byte |
--map | print the line number table: each line and its object code address |
--replace | allow replacing a file that is already on a disk image |
decompile
aascad decompile OBJECT [-o LISTING] [--bas PROGRAM]. The memory layout comes from the object’s header; the code options are found by trying each combination until the recompiled program matches.
| Option | Meaning |
|---|---|
OBJECT | a TASC object file |
-o LISTING | write the Applesoft listing here (default: print it) |
--bas PROGRAM | also write the tokenized Applesoft program |
--load ADDR | the object’s load address, if it can’t be found (a file from a disk image brings its own; otherwise it is read from the object’s header) |
--replace | allow replacing a file that is already on a disk image |
Files and disk images
Files are read from and written to the local filesystem. A file inside a DOS 3.3 disk image is named IMAGE::NAME, for example TASC.dsk::BALL. Images are handled by CiderPress II’s command-line program, found through --cp2 PATH (given before the command), the CP2PATH environment variable, or cp2 on the PATH. An object written to an image is a binary file at its load address; a listing or --bas program is an Applesoft file. A file already on the image is replaced only with --replace.
Addresses may be decimal, $hex or 0xhex.
Examples
python3 aascad.py compile BALL.txt -o BALL.OBJ python3 aascad.py compile BALL.txt --no-int-arith --compare ORIGINAL.OBJ python3 aascad.py decompile BALL.OBJ -o BALL.txt --bas BALL.bas python3 aascad.py compile "TASC.dsk::BALL" -o "WORK.dsk::BALL.OBJ" python3 aascad.py --cp2 /opt/cp2/cp2 decompile "TASC.dsk::PASS1" -o PASS1.txt python3 aascad.py compile --help
Copyright
AASCAD is copyright © 2026 Lydian Scale Software. Portions are the work of Microsoft: the code sequences and object file layout it reproduces and the RUNTIME library entry points it calls are those of TASC (copyright © 1981 Microsoft), and its number conversion follows the Applesoft ROM (Microsoft and Apple). AASCAD is not a Microsoft product.