Aztec C 3.2b on one 800K disk

/ Apple IIe / updated 2026-09-11 aztec-c prodos applecommander 6502 merlin

I had the ProDOS release of Aztec C65 3.2b sitting around as eight 140K disk images. Swapping eight floppies to compile a file is nobody’s idea of fun, and I have a 3.5" drive on the IIe, so I wanted the whole thing on one 800K disk.

What I tried

AppleCommander’s acx did the merging. Created an 800K ProDOS image named /AZTEC, made CC, LN and UTIL directories, and copied the tools across from each disk. Every .LIB went into LN/ so the linker’s CLIB variable finds them in one place. The shell’s PROFILE assumed four separate volumes (/system, /cc, /ln, /util), so I rewrote it:

set PATH=:/ram:/aztec:/aztec/cc:/aztec/ln:/aztec/util
set INCLUDE=/aztec/cc/include
set CLIB=/aztec/ln/

Two acx surprises. create -f to copy boot blocks off the SYSTEM disk died with a null pointer, I think because there’s no BASIC.SYSTEM on it. And write -b refused to write blocks 0 and 1 to the 800K image at all. Ended up reading the two boot blocks out of the SYSTEM disk and dd-ing them into the first 1024 bytes of the .po file.

The eight disks hold more than 800K, so the .ARC library source archives and the DOS 3.3 target libs went on a second image. You don’t need either to compile.

First boot of the merged disk. Aztec C SHELL v1.99j, PROFILE banner, prompt.
First boot of the merged disk. Aztec C SHELL v1.99j, PROFILE banner, prompt.

It booted first try. Then I typed cc exmpl.c and got this:

cc ran, as ran, then the shell couldn't reload itself. Any key just prints it again.
cc ran, as ran, then the shell couldn’t reload itself. Any key just prints it again.

The Manx shell unloads itself to run a program and reloads SHELL.SYSTEM afterward. The reload is a little native stub the shell parks at $BD51, and it builds the pathname from a directory string the shell stashed at $BC11 plus the literal SHELL.SYSTEM. That stub loops forever on failure, so a reboot is the only way out. Typing set showed the problem:

set output. HOME is /AZTEC//AZTEC/SHELL.SYSTEM, which ProDOS rejects.
set output. HOME is /AZTEC//AZTEC/SHELL.SYSTEM, which ProDOS rejects.

The shell computes its home as the ProDOS prefix plus whatever is sitting at $0280, the spot where the launcher leaves the name of the system file it just loaded. Manx assumed a bare filename there, which is what a 1986 Disk II boot gave them. On this machine $0280 had the full path, so the shell glued /AZTEC/ onto /AZTEC/SHELL.SYSTEM, and the double slash is an invalid ProDOS pathname. Setting HOME in PROFILE doesn’t help; the stub gets its copy during init, before PROFILE runs.

The fix is a loader that boots first. AZTEC.SYSTEM is 186 bytes of 6502: copy itself to $0300, SET_PREFIX to /AZTEC/, OPEN and READ SHELL.SYSTEM into $2000, write a bare SHELL.SYSTEM string to $0280, jump. ProDOS boots the first *.SYSTEM file in directory order, so I deleted SHELL.SYSTEM and re-added it after the loader.

With the loader in front. HOME is /AZTEC/ and cc comes back to the prompt.
With the loader in front. HOME is /AZTEC/ and cc comes back to the prompt.

cc calls as on its own, so there’s no separate assemble step. cc -A stops after codegen and leaves the .asm for reading.

Tail of the generated asm for hello world, then the link. 11,898 bytes total.
Tail of the generated asm for hello world, then the link. 11,898 bytes total.

What I measured

What broke or surprised me

Next

Nothing on the C side. This was a one-off to see what the experience was like, and the answer is that Merlin is a better place to write for this machine. The disk stays useful for grep, diff, hd and a working 800K ProDOS boot. The loader trick applies to any old system program that expects a bare name at $0280.