PBXA32 - Compiler Werkstatt
Alpha Vorschau — Nativer x86-32 Compiler

PBXA32 ALPHA

V0.2 — C11 Scaffold

A complete x86-32 compiler pipeline written in ISO C11. From PowerBASIC source through preprocessor, lexer, parser, semantic analysis, IR, x86 code generation, COFF assembly, and PE32 linking — all in one toolchain. No C++ dependencies. No GNU extensions. Just pure standard C11 producing native Windows PE32 executables.

Alpha — Download kommt bald
Download Coming Soon Help File (CHM) Alpha Preview

Written in ISO C11 (no C++, no GNU)

Target: x86-32 / PE32

7 smoke tests passing

7Complete stages: Preproc → Lex → Parse → Sem → CodeGen → Asm → Link
C11Written in strict ISO C11. Portable. No external dependencies.
PE32Native x86 Windows executables. No GCC. No LLVM.
7/7Subsystem smoke tests: Lexer, Parser, Preproc, Codegen, Asm, Linker, Common

Why PBXA32 Matters

Pure C11 Implementation

The entire compiler — lexer, parser, preprocessor, code generator, assembler, linker, runtime — is written in standard ISO C11. No C++. No GNU extensions. Builds with any C11-compliant compiler including MinGW-w64, MSVC, and Clang.

Complete x86-32 Pipeline

All seven compiler stages are implemented and tested. Tokenize PowerBASIC syntax, build an AST, lower to IR, generate x86 machine code, emit COFF objects, and link to PE32 — a full end-to-end compiler in C.

PowerBASIC Compatible

Supports directives (#COMPILE, #INCLUDE, #DIM), procedures (FUNCTION, SUB, CALLBACK), control flow (IF, SELECT, FOR, DO, WHILE), jumps (GOTO, GOSUB), aggregates (TYPE, UNION, ENUM), and classic type suffixes (% & && ! # $ @).

Per-Subsystem Smoke Tests

Every stage has its own dedicated smoke test. Test the lexer independently. Test the parser. Test the assembler. Test the linker. Isolate bugs to their layer without compiling full programs.

Quick Example

#COMPILE EXE "hello.exe" #DIM ALL FUNCTION PBMAIN() AS LONG PRINT "Hello from PBXA32!" FUNCTION = 0 END FUNCTION
pbxa32c hello.bas -o hello.exe hello.exe Hello from PBXA32!

Completed Subsystems

StageStatusDescription
PreprocessorCompleteMacro expansion, conditional compilation (#IF/#ENDIF), file includes
LexerCompletePowerBASIC-aware tokenizer with full numeric literal support
ParserCompleteRecursive-descent parser building full AST
SemanticCompleteType system, symbols, analyzer
IRCompleteIR module and lowering
CodeGenCompleteIR-to-x86 machine code generator
AssemblerCompletex86/COFF assembler and object writer
LinkerCompletePE32/i386 linker with import support
RuntimeCompleteRuntime library for compiled programs
Optimizer4 StubsOptimization pipeline scaffolded, ready for passes

Architecture — From Source to PE32

Source (.bas) |-> Preprocessor (MACRO, #IF, #INCLUDE) |-> Lexer (PB tokens, identifiers, literals) |-> Parser (AST construction) |-> Semantic Analysis (type checking, symbol binding) |-> IR Lowering (unified intermediate representation) |-> x86 CodeGen (machine code generation) |-> Assembler (COFF object emission) |-> Linker (PE32 image generation)

Alpha Preview

PBXA32 is in active alpha development. The complete compiler, smoke tests, and documentation will be available for download with the first public alpha release.