The VBCC Compiler¶
VBCC (Volker Barthelmann's C Compiler) is a highly optimizing, portable, retargetable ISO C compiler maintained by Volker Barthelmann since 1995. It is one of the three C compilers practically usable on AmigaOS today, alongside SAS/C 6.50 (the legacy commercial 68k toolchain, sold separately from the NDK) and the GCC 68k ports (GCC 2.95.3 and later are supported by the NDK 3.2 headers). Source: VBCC manual, Volker Barthelmann, February 2022.
Overview¶
VBCC is split into a target-independent frontend and a target-dependent backend. Targets and hosts are decoupled — a single vbcc build can compile for many different CPUs and OSes. The compiler supports ISO C89 fully and a subset of C99, and provides aggressive high-level optimizations including:
- Cross-module function inlining
- Inter-procedural data-flow analysis
- Inter-procedural register allocation
- Global common-subexpression elimination
- Global constant and copy propagation
- Dead-code elimination
- Alias analysis
- Loop unrolling, induction-variable elimination, loop-invariant code motion, loop reversal
- Target-specific optimizations
For embedded and bare-metal targets, VBCC supports differently-sized pointers (function/object, near/far), ROM-able code, inline assembly, bit-types, interrupt handlers, section attributes, and stack calculation.
Licensing¶
VBCC is copyright 1995–2022 by Volker Barthelmann. The archive may be redistributed without modifications and used for non-commercial purposes.
Exception for commercial use: when the target CPU is M68k and the target OS is AmigaOS, resulting binaries may be distributed commercially without further licensing. In all other cases (other CPUs, other OSes, or non-AmigaOS targets) the author's written consent is required.
This makes VBCC particularly attractive for commercial AmigaOS 68k software, where the alternative SAS/C 6.50 is showing its age.
Amiga targets¶
VBCC supports a wide range of Amiga-family targets through dedicated configuration files:
| Config | Target | Notes |
|---|---|---|
kick13 |
AmigaOS 1.x (M68k) | Standard startup code |
kick13m |
AmigaOS 1.x (M68k) | Minimal startup code |
kick13r |
AmigaOS 1.x (M68k) | Resident programs |
aos68k |
AmigaOS 2.x/3.x (M68k, 68020+) | Default 68k target |
aos68km |
AmigaOS 2.x/3.x (M68k) | Minimal startup code |
aos68kr |
AmigaOS 2.x/3.x (M68k) | Resident programs |
powerup |
PowerUp kernel (AmigaOS 3.x on PPC accelerators) | |
warpos |
WarpOS kernel (AmigaOS 3.x on PPC accelerators) |
The naming convention is <target>_<host>. For example, aos68k_powerup is "compile for AmigaOS/68k using a compiler running on PowerUp". By default, the 68020-native tools are used on AmigaOS 2.x/3.x.
The aos68km and aos68kr variants trade full C runtime support for tiny executables: aos68km produces the smallest possible C program; aos68kr is for resident commands and skips normal startup.
Installation on AmigaOS¶
VBCC for AmigaOS is distributed as a set of LHa archives, installable via the standard AmigaOS Installer. The binary archives contain the host-side tools; the target archives contain the headers and libraries for the corresponding target.
Typical installation pattern (host is AmigaOS 2.x/3.x on 68020+):
- Run the Installer on the
vbcc_bin_amigaos68karchive. - Run the Installer on the target archives you need (e.g.,
vbcc_target_m68k-amigaos). - Add the following assigns to your
S:User-Startup:
assign >NIL: vbcc: <path to vbcc directory>
assign >NIL: C: vbcc:bin add
assign >NIL: vincludeos3: vbcc:targets/m68k-amigaos/include
assign >NIL: vincludeos3: <path to your AmigaOS 3.x NDK headers> ADD
assign >NIL: vlibos3: vbcc:targets/m68k-amigaos/lib
Repeat the vinclude* and vlib* assigns for each target you install.
Use the NDK 3.2 headers for AmigaOS 2.x/3.x development. Since NDK 3.2 (vbcc support added in R3, full inline support in R4) the official
Include_H/proto/headers handle__VBCC__andInclude_H/inline/*_protos.hprovides vbcc inline calls, so vbcc can use the official NDK directly instead of its own header set. For AmigaOS 1.x, use the original Kickstart 1.x headers to avoid relying on features that didn't exist back then.
Building a program¶
vc is the unified frontend. Default config is read from vc.config in the VBCC directory; you can also pick a config explicitly with the + option:
vc +aos68k hello.c -o hello
For cross-compilation, the host comes after the target:
vc +aos68k_powerup hello.c -o hello
The frontend takes care of invoking the compiler, assembler, and linker in sequence — you do not call them individually. Options that look like Unix cc are supported.
Floating point and math libraries¶
For floating-point programs on m68k targets, you need a math library. The choice depends on which FPU your program will run on:
| Library | FPU / target |
|---|---|
-lmieee |
IEEE-format software floating point (any CPU) |
-lm881 |
68881 FPU |
-lm040 |
68040 built-in FPU |
-lm060 |
68060 built-in FPU |
The math library is linked automatically when you pass the appropriate flag to vc:
vc calc.c -o calc -lmieee
Stack sizing¶
Binaries that don't auto-adjust the stack themselves need an explicit stack. 64 KB is a reasonable starting value; very large projects may need more. Adjust via the Workbench icon's "Stack" field, the Shell's STACK command, or via a __stack cookie in the source.
Why VBCC for AmigaOS¶
- Source available, free for non-commercial use, and commercial distribution allowed for 68k AmigaOS binaries (see Licensing above).
- Modern C99 support vs SAS/C 6.50's C89 focus.
- Modern optimizer — VBCC's inter-procedural analysis and cross-module inlining routinely produce code 20–40% smaller and faster than SAS/C at comparable optimization effort.
- Active maintenance — Volker Barthelmann still updates VBCC; SAS/C development ended in the mid-1990s (last patch 6.58).
- Cross-target — one compiler binary produces code for 68k AmigaOS, WarpOS, PowerUp, and Atari, plus embedded targets.
Drawbacks:
- CodeProbe-style integration requires manual setup; the SAS/C debugger does not understand VBCC's debug info without conversion.
- Some Amiga-specific pragmas (notably
#pragma libcalland SAS-specific calling-convention keywords) are not present; VBCC calls libraries through inline functions using__reg("a6")register qualifiers and inline assembler strings (seeInclude_H/inline/exec_protos.h).
See Also¶
- SAS/C Compiler Reference — the legacy commercial 68k toolchain (never part of the NDK).
- SAS/C Portable C — wrapping patterns for code that compiles under both SAS/C and VBCC.
- Coding Standards
- AmigaOS Hunk Binary Format — the on-disk format VBCC emits for 68k targets.
- Amiga Compilers — landing page for the Amiga compiler ecosystem.
Sources: Volker Barthelmann, "vbcc — VBCC Compiler System" (manual), February 2022, sections 1.1, 1.2, 1.3.3, 14.5, 14.10. Source URL: https://www.compilers.de/vbcc.html.
Raw: raw/compilers/vbcc-manual-extract.txt
Updated: 2026-10-04