PBXA64 - Compiler Werkstatt
Alpha Vorschau — Nativer x86-64 Compiler

PBXA64 ALPHA

V30 — Complete Feature Pass

A native Windows compiler that transforms PowerBASIC-compatible BASIC source code directly into PE32+ executables and DLLs. Full EXPORT/ALIAS/ORDINAL support. A hardened preprocessor with MACRO and #IF. Inline #ASM blocks that bind directly to PB symbols. V30 completes the WSTRING builtin suite, adds #OVERRIDE for builtin function replacement, MODULE unit support (Delphi-style), full file I/O (BINARY/RANDOM/Unicode), and 120 automated tests with 100% pass rate.

Alpha — Download kommt bald

Release: ~747 KB (exe + help + WinAPI includes)

Digitally signed by Theo Gottwald

120 automated tests passing (100%)

7Stage pipeline: Preproc → Lex → Parse → Sem → CodeGen → Asm → Link
120Automated tests passing at 100% across all command families
EXE + DLLx64 PE32+ executables & DLLs with EXPORT/ALIAS/ORDINAL
3Language frontends: BASIC, PILOT, MGC macro language

Why PBXA64 Matters

Native x64 CodeGen

Direct assembly emission to x64 machine code. No GCC dependency. No C transpilation. No LLVM. Your BASIC becomes native PE32+ executables and DLLs through a dedicated pipeline built from the ground up.

DLL Export Engine

Full EXPORT, EXPORT ALIAS "Name", and EXPORT ORDINAL n support. Multiple #COMPILE directives in a single source file can fan out to build both EXE and DLL targets simultaneously.

MODULE Units (Delphi-Style)

MODULE Name ... END MODULE with INTERFACE and IMPLEMENTATION sections. IMPORT other modules for cross-unit visibility. PUBLIC/PRIVATE per declaration. The compiler resolves cross-module function calls automatically.

#ASM With PB Symbol Binding

Inline assembly blocks that use your PowerBASIC variable and parameter names directly. The compiler resolves each symbol to its current register assignment or stack slot. No manual register tracking required.

Rich Preprocessor + #OVERRIDE

#DEFINE, MACRO/MACROFUNCTION, MACROTEMP, #IF/#ENDIF, #INCLUDE ONCE, %DEF(), and conditional compilation. New #OVERRIDE lets you replace any builtin function (LEN, ASC, TRIM$, etc.) with custom PB or #ASM code, dispatched by exact parameter type match.

Quick Example

#COMPILE EXE "hello.exe" #DIM ALL FUNCTION PBMAIN() AS LONG PRINT "Hello from PBXA64 V30!" FUNCTION = 0 END FUNCTION

DLL Example

math.dll Source

#COMPILE DLL "math.dll" #DIM ALL FUNCTION AddOne(BYVAL x AS LONG) EXPORT AS LONG FUNCTION = x + 1 END FUNCTION SUB Ping() EXPORT ALIAS "PB_Ping" END SUB

Build & Use

pbxa64 math.pb ' produces math.dll pbxa64 app.pb ' links math.dll imports ' Declare in your app: DECLARE FUNCTION AddOne LIB "math.dll" _ ALIAS "AddOne" (BYVAL x AS LONG) AS LONG

DLLs support EXPORT, EXPORT ALIAS "Name", and EXPORT ORDINAL n. Multiple #COMPILE directives in one source build both EXE and DLL.

Feature Timeline

VersionReleaseKey Features
V30Complete Feature PassWSTRING builtin completion (LEFT$/RIGHT$/MID$/TRIM$/UCASE$/LCASE$/REPEAT$/STRREVERSE$ on WSTRING), #OVERRIDE builtin function replacement, MODULE unit system, full file I/O (BINARY/RANDOM/Unicode ENCODING), 120 tests at 100% pass
V29String64 & WSTRING FoundationString64 descriptor protocol (ptr/len/cap), WSTRING scalar ops, UDT with STRING/WSTRING fields, WSTRING WinAPI/console/file lowering, VARARG WSTRING, CODEPTR, CALLBACK prologue guard, PILOT retention guard
V28Limit CompletionLIKE wildcard, PRINT USING, ARRAY DELETE/INSERT, LINE GDI drawing, hardened #ASM with PB symbol binding
V26Error, DATA, Array, File, FormatON ERROR/RESUME, DATA/READ/RESTORE, ARRAY ASSIGN/SORT/SCAN, FILECOPY/RMDIR/GETATTR, MIN/MAX/IIF, BUILD$/CLIP$, LIKE, #ASM, LINE graphics scaffold
V25Memory & String CommandsPOKE/PEEK, MKI$/MKL$/MKQ$ packing, CV* unpacking, JOIN$/SPLIT, MID$ statement, NUL$/DEC$
V24String Completion20 string commands: REPEAT$, STRDELETE$, STRINSERT$, STRREVERSE$, BIN$/OCT$, LTRIM$/RTRIM$, REPLACE$, SCAN$, TALLY, VERIFY, COMMAND$, ENVIRON$, CURDIR$, TAB$, PEEK$, INPUT$, INKEY$, WAITKEY$
V23DLL Output#COMPILE DLL, FUNCTION EXPORT/ALIAS/ORDINAL, multi-#COMPILE fan-out, .edata PE section
V22Macro Preprocessor#DEFINE, MACRO/MACROFUNCTION, MACROTEMP, #INCLUDE ONCE
V21Core Commands#IF/#ENDIF, %DEF(), INSTR/CHR$/ASC/STR$/VAL, DATE$/TIME$, SLEEP/SWAP, XOR/EQV/IMP
V10–V20FoundationPB parser, semantic analysis, x64 codegen, COFF/PE linker, PILOT, STRING/WSTRING, arrays, UDTs, file I/O, WinAPI, callbacks

Architecture — From Source to PE

Source (.pb/.bas/.pbi) |-> Preprocessor (MACRO, #IF, #INCLUDE, #OVERRIDE block capture) |-> Lexer (PB tokens, identifiers, literals) |-> Parser (AST construction, MODULE unit parsing) |-> Semantic Analysis (type checking, cross-module symbol binding) |-> x64 CodeGen (direct assembly emission, WSTRING/String64 runtime) |-> Assembler (x64 encoding, COFF output) |-> Linker (COFF to PE32+/DLL, imports, exports)

Alpha Preview

PBXA64 is in active alpha development. The complete compiler, documentation, and test suite will be available for download with the first public alpha release.