X-Code
X-Code is a separate embedded assembler frontend with a typed dialect and its own parser, command catalogue, virtual registers and register allocation. Within BASIC source it opens with #XCODE and closes only with #ENDX. Its expansion then passes through the integrated inline assembler.
A standalone .asm file uses the ASM frontend. #ASM … #ENDASM, #ACODE … #AEND and individual ! lines use ordinary assembly instructions. X-Code adds X.VREG, X.ADD, X.CLAMP, structured control flow and memory commands. It is an additional embedded dialect layer; the nine registered language inputs reported by --print-capabilities=json plus the separate ASM input are therefore not counted as eleven standalone file frontends.
Options and workflow
OPT=0..3, SPILL=AUTO|ERROR, FEATURES=BASELINE|AUTO|…, REGALLOC=AUTO|MANUAL, APX=AUTO|EMULATE|NATIVE|CHECK.
Virtual registers have types such as U32, U64, I32 or F64. Operands must match each command: X.CLAMP bounds are virtual registers of the same type, rather than immediate numbers. --emit-xcode-asm and --xcode-allocation-report expose the expanded assembly and register allocation.
1. Dedicated X-Code commands
V21: compiled and executed natively on 2026-09-30. The code asserts the clamped result 10; a mismatch returns error 1.
Open checked source2. Use BASIC variables directly
X.LOAD reads the BASIC variable and X.STORE writes the result. V21: native assertion 21 × 2 = 42 passed. DWORD PTR explicitly selects a 32-bit access here.
Open checked source3. Bridge from another frontend
BRIDGE IMPORT binds the exported ASM symbol. V21: both sources compiled together; the native test asserts the initial value 41 and the update to 42. This is shared variable storage rather than a copied value.
Open checked sourceprovider.asm
The bridge can bind registered variables from other frontends to BASIC. This specific example checks ASM → BASIC → X-Code; it does not automatically establish every other language pairing.
4. Emulate APX with a separate destination
V21: translated and executed natively on the current x64 system; result 1 + 2 = 3 asserted. Emulation maps APX registers onto existing x64 registers and does not require native APX hardware for this example.
Open checked sourceFixed in V23
With add r16, r17, r16 and initial values 1 and 2, the emulation in the released V8 compiler (PBXB64 V23) returns the correct result 3, also when the destination is one of the source registers. Checked on 2026-10-05 on a processor without APX.
5. Inspect native APX encoding
V21: compilation and encoding checks only. Expected REX2/EVEX bytes are present. This program was not executed natively; the CPU must support the APX instructions used. Translation does not prove hardware execution.
Open checked sourceThese three lines are checked excerpts of native.asm. APX-EMULATE and APX-NATIVE have different verification scopes.
Verification and references
The stated checks use the byte-identical PBXB64 0.50.0-V21 executable from the PBX V7 package. Inputs, verification scope, compiler hash and timestamp are recorded per example. Individual examples do not replace full compiler qualification. The shipped frontend documentation and X-Code chapters of the CHM help cover block syntax, commands, registers, options and APX.
View verification receipts#OVERRIDE / Preprocessor