PBXB64 - Compiler Werkstatt
V4 — Native x86-64 Multi-Frontend Compiler

PBXB64 V4 RELEASE

PBXB64 is a native Windows compiler written in pure C17. Five languages — B64, BASIC, C, ASM, PILOT — flow through a single IR pipeline and an x64 backend to native PE32+. No GCC, no LLVM, no external toolchain. Direct x64 instruction selection, built-in assembler, built-in COFF/PE linker. FOR/NEXT fully covered for all 7 integer types plus float. 318/318 tests green, signed build, UPX-packed to ~856 KB.

318/318 Tests 5 Language Frontends UPX-Packed 856 KB 8-Stage Pipeline Win64 Native Digitally Signed
Download PBXB64 V4 (ZIP) Documentation (CHM) ZIP downloads: --  ·  CHM downloads: --

Package: ~8.9 MB (ZIP) — compiler, CHM, 1233 .pbi includes, 127 samples

Digitally signed by Theo Gottwald

318/318 tests passing

5Language frontends: B64, BASIC, C, ASM, PILOT
318/318Tests green — 0 failures, 0 expected fails
8Stage pipeline: Lex → Parse → IR → Opt → CodeGen → Asm → COFF → PE
856 KBUPX-packed — full toolchain in a single binary

Test Lane: What’s Green

The full PBXB64 build is accompanied by an automated test suite that verifies assembly generation, linker resolution, and runtime correctness for every language and feature.

190/190Assembly (-S)
20/20PB Link+Run
13/13B64 Link+Run
63/63C Compile
1/1C Link+Run

Why PBXB64?

True native x64 code

No dependency on GCC, LLVM, or a C runtime. The compiler emits x64 machine code directly – from PowerBASIC or B64 source to an executable PE32+ in a single pass. Maximum control, minimum binary size, no third-party surprises.

Multi-frontend: 5 languages

Write code in B64, PowerBASIC, C (C17 subset), PILOT or raw x64 assembly – all in the same project. The compiler mixes the languages at IR level and emits a single PE. Add a new language and instantly inherit the entire native backend.

Custom x64 backend

Direct instruction selection, register allocation, peephole optimization and PE32+ image generation — written in C17. The entire backend is ~14,000 LOC in core/source/backend/x64/ plus a ~5,000-LOC native x64 assembler encoder. No external dependencies.

Custom PE32+ linker

No external linker needed. The integrated linker processes COFF objects, generates import tables, relocations, TLS and exception data. Full PE32+ compatibility from Windows XP through Windows 11.

Language Frontends in Detail

B64 (.b64)

C-like systems language with manual memory management, raw pointers, structs, function pointers and globals. Primary frontend — systems code using the same pipeline that also handles BASIC and PILOT. 13/13 link+run tests green.

PowerBASIC (.pb, .bas)

PowerBASIC-compatible dialect: FUNCTION/SUB, LOCAL/GLOBAL/SHARED, TYPE/UNION/ENUM, full FOR/NEXT semantics for all integer and float types, negative STEP, nested loops. 20/20 link+run tests green.

C (.c, .h)

C17 subset: #include, #define, #if/#ifdef/#endif, full lexer/parser, struct/union/typedef/enum, switch/case, function pointers. 33 C17 headers included. 63/63 compile tests + 1/1 link+run test green.

Inline Assembly (.asm, .s)

Direct x64 assembler with Intel and AT&T syntax. Native COFF/PE emission, no intermediate language. Full control over registers, SSE and system calls.

PILOT (.pil)

Educational language. Full T:/A:/M:/Y:/N:/J:/U:/E: command set, conditional suffixes, pattern matching. Ideal for teaching and simple scripts.

Mixed-Language Projects

PowerBASIC + inline ASM in the same module. B64 calls C functions. PILOT drives a C program. The shared IR layer makes it all possible.

Quick Examples

B64

fn add(a: i32, b: i32): i32 { return a + b; } fn main(): i32 { let x: i32 = add(40, 2); return x; // 42 }

PowerBASIC

FUNCTION PBMAIN() AS LONG LOCAL g AS LONG g = 0 FOR i = 1 TO 3 g = g + i NEXT FUNCTION = g ' = 6 END FUNCTION

C

#include int main(void) { printf("Hello from PBXB64 C!\n"); return 0; }

V4 Highlights — FOR/NEXT Coverage

V4 fixes the long-standing “FOR-body constant-fold” problem and adds full FOR/NEXT type coverage per the PB spec. Float FOR was fully debugged in Z62 and now runs reliably.

CategoryDetails
Integer FOR7 intlike types (LONG, INTEGER, QUAD, DWORD, WORD, BYTE, CURRENCY) — positive and negative STEP
Float FORSINGLE, DOUBLE — FOR f = 1.0 TO 3.0 — fully debugged in Z62
Nested Loops2-deep, 3-deep, with dependent bounds FOR j = 1 TO i
Backend correctnessSSE movq ModRM, SSE-arith ModRM, peephole pass 4 imm64 truncation, SETCC partial-write, peephole dead-reg, PB frontend slot-float const-fold — all 5 fixed

Architecture — From Source to Silicon

Source (.b64/.pb/.c/.asm/.pil) |-> Lexer (per-language tokenizer, ~3,000 LOC total) |-> Parser (per-language AST, ~12,000 LOC total) |-> IR Builder (unified intermediate representation) |-> Optimizer (pass manager, CFG, dominance, ~6,000 LOC) |-> x64 CodeGen (register allocation, instruction selection, ~14,000 LOC) |-> Assembler (x64 encoding, fixups, ~5,000 LOC) |-> COFF Writer (object file emission) |-> PE Linker (import table, relocations, PE32+ image, ~3,000 LOC)

Build & Run

Build (Windows + MinGW)

cd core build_mingw64.bat build\PBXB64.exe --version # PBXB64 version 0.50.0-z62

Compile a PB program

PBXB64 hello.pb -o hello.exe hello.exe echo %ERRORLEVEL%

Compile a B64 program

PBXB64 answer.b64 -o answer.exe answer.exe # exits 42

Compile a C program

PBXB64 -std=c17 hello.c -o hello.exe hello.exe

What’s in the ZIP Package?

File / FolderContents
PBXB64.exe856 KB UPX-packed compiler, digitally signed (Theo Gottwald)
PBXB64_Help.chmCompiled Windows help with full command reference
README.mdRelease notes, license, contact
SHA256.txtSHA-256 hashes for integrity verification
Includes/1233 PB include files (.pbi) for Windows API, JSON, HTTP, OAuth, SMTP, COM, NetX, and more
Samples/127 example programs in 5 categories (asm, b64, basic, c, pb)

Download PBXB64 V4 now

Full release package: compiler, CHM help, 1233 PB include files, 127 sample programs. UPX-packed to 856 KB, digitally signed by Theo Gottwald.