Command-Line Options
Usage
pbxa64 [options] <input files>
Options Reference
| Option | Description |
--target=win32 | Generate native x86/i686 COFF and Windows PE32 output. |
--target=win64 | Generate native x64 COFF and Windows PE32+ output. |
-o <path> | Output file path. Default depends on mode: a.exe (link), a.obj (compile-only), a.asm (assembly). |
-c | Compile only — produce a .o COFF object file without linking. |
-S | Emit assembly only — output .asm text file instead of binary. Includes comment header with compiler version and command line. |
--asm:<path> | Save generated assembly to file, then continue compiling and linking (unlike -S which stops). Assembly includes comment header. |
--dump-tokens | Dump the lexer token stream to stdout. Useful for debugging lexer behavior. |
--dump-ast, --emit-ast | Dump the abstract syntax tree to stdout after parsing. |
--dump-ir, --emit-ir | Dump the intermediate representation to stdout after IR lowering. |
-O0 | No optimization (default). Fastest compilation, no transforms applied. |
-O1 | Basic optimization — enables simple peephole and local transforms. |
-O2 | Aggressive optimization — enables all available optimization passes. |
-O3 | Maximum optimization — highest optimization level. |
-v, --verbose | Verbose output — prints additional diagnostic information during compilation. |
-h, --help | Show the help message and exit. |
--version | Show version banner and exit. |
Windows Target Selection
PBXA64 itself is a 64-bit compiler executable. The --target option selects the architecture of the generated program, not the architecture of the compiler process. PowerBASIC, the supported C frontend, and assembler support both Windows targets.
| Option | CPU | Windows image |
--target=win32 | x86 / i686 | PE32 |
--target=win64 | x64 | PE32+ |
Input Files
| Extension | Frontend | Description |
.pb | PowerBASIC | Primary PowerBASIC source file |
.bas | PowerBASIC | PowerBASIC source file (alternate) |
.pbi | PowerBASIC | PowerBASIC include file |
.mgc | MGC | C-like intermediate language source |
Examples
# Build the same PowerBASIC source for both Windows targets
PBXA64.exe --target=win32 program.bas -o program32.exe
PBXA64.exe --target=win64 program.bas -o program64.exe
# Compile to object file only
pbxa64 -c program.bas -o program.obj
# Generate assembly listing
pbxa64 -S program.pb -o program.asm
# Debug token stream
pbxa64 --dump-tokens hello.pb
# Debug AST
pbxa64 --dump-ast hello.pb
# Debug IR with optimization
pbxa64 --dump-ir -O1 program.mgc