Command-Line Options

Usage

pbxa64 [options] <input files>

Options Reference

OptionDescription
--target=win32Generate native x86/i686 COFF and Windows PE32 output.
--target=win64Generate 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).
-cCompile only — produce a .o COFF object file without linking.
-SEmit 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-tokensDump the lexer token stream to stdout. Useful for debugging lexer behavior.
--dump-ast, --emit-astDump the abstract syntax tree to stdout after parsing.
--dump-ir, --emit-irDump the intermediate representation to stdout after IR lowering.
-O0No optimization (default). Fastest compilation, no transforms applied.
-O1Basic optimization — enables simple peephole and local transforms.
-O2Aggressive optimization — enables all available optimization passes.
-O3Maximum optimization — highest optimization level.
-v, --verboseVerbose output — prints additional diagnostic information during compilation.
-h, --helpShow the help message and exit.
--versionShow 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.

OptionCPUWindows image
--target=win32x86 / i686PE32
--target=win64x64PE32+

Input Files

ExtensionFrontendDescription
.pbPowerBASICPrimary PowerBASIC source file
.basPowerBASICPowerBASIC source file (alternate)
.pbiPowerBASICPowerBASIC include file
.mgcMGCC-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