Multiple source languages compile to native Windows programs. ASM and XCODE offer additional workflows inside BASIC.
Multiple source languages compile to native Windows programs. ASM and XCODE offer additional workflows inside BASIC. Open full-size diagram

Language inputs and X-Code

A dedicated tutorial for each input

B64

B64 uses typed variables and functions with brace-delimited blocks. These examples cover loops, parameters and an explicit loop exit.

12 short examples + larger example

ASM

There are two workflows: #ASM blocks inside BASIC and standalone .asm source files. The first example uses a BASIC wrapper; the others use the separate ASM input.

12 short examples + larger example

X-Code

X-Code is a typed assembler dialect inside BASIC. Virtual registers describe values; the compiler assigns physical registers. Memory operations specify their width explicitly.

12 short examples + larger example

Logo

Logo examples use named values, list blocks and clear commands. These examples focus on console computation; turtle graphics are a separate area.

12 short examples + larger example

Forth

Forth operates on a data stack. Numbers push values; words such as +, DUP and EXECUTE consume or produce them. Order is part of the program.

12 short examples + larger example

PILOT

PILOT uses prefixes such as C: for calculations, T: for text and J: for jumps. #names are numeric variables; $names identify strings.

12 short examples + larger example

COBOL

COBOL separates identification, data description and execution. PIC describes data format; DISPLAY produces output and STOP RUN ends the program.

12 short examples + larger example

Rust

The Rust input uses fn, let and explicit types. These small examples cover loops, integer arithmetic and tuples; they are not a promise of arbitrary Cargo-project compatibility.

12 short examples + larger example

Bridging

Six source pairs: function calls, shared variables and typed bindings.

Understand bridges

Tested quick examples for every language input and X-Code

Every program calculates the sum from 1 to 5. B64, PowerBASIC, C, ASM and Rust return process exit code 15; Logo, Forth, SPR and PILOT print 15, while COBOL prints 15. X-Code is a typed assembler dialect inside a BASIC program.

Tested with the V22 candidate on 30 September 2026; publication is pending. All eleven examples were compiled and executed natively. X-Code was also checked at O0 through O3.

B64

Detailed examples and explanation

fn main(): i64 { let sum: i64 = 0; let i: i64 = 1; while i <= 5 { sum = sum + i; i = i + 1; } return sum; // 15 }

Exit code 15

PBXB64.exe sum15-b64.b64 -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

PowerBASIC

Detailed examples and explanation

FUNCTION PBMAIN() AS LONG LOCAL sum AS LONG LOCAL i AS LONG sum = 0 FOR i = 1 TO 5 sum = sum + i NEXT FUNCTION = sum ' = 15 END FUNCTION

Exit code 15

PBXB64.exe sum15-powerbasic.pb -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

C

Detailed examples and explanation

#include <stdio.h> int main(void) { int sum = 0; for (int i = 1; i <= 5; i++) { sum += i; } return sum; /* 15 */ }

Exit code 15

PBXB64.exe sum15-c.c -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

ASM

Detailed examples and explanation

The ASM quick example uses #ASM … #ENDASM inside a BASIC program. A standalone .asm file uses the separate ASM input; the X-Code page includes a jointly compiled example.

FUNCTION PBMAIN() AS LONG LOCAL sum AS LONG #ASM xor eax, eax ; sum = 0 mov ecx, 5 ; counter = 5 add_loop: add eax, ecx ; sum += counter dec ecx ; counter-- jnz add_loop ; loop until 0 mov %sum, eax ; store result #ENDASM FUNCTION = sum ' = 15 END FUNCTION

Exit code 15

PBXB64.exe sum15-asm.pb -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

XCODE

Detailed examples and explanation

#COMPILE EXE #DIM ALL FUNCTION PBMAIN() AS LONG LOCAL total AS LONG #XCODE X.VREG sum:U64 X.MOVE V(sum), 1 X.ADD V(sum), 2 X.ADD V(sum), 3 X.ADD V(sum), 4 X.ADD V(sum), 5 X.STORE QWORD PTR [total], V(sum) #ENDX FUNCTION = total END FUNCTION

Exit code 15

PBXB64.exe sum15-xcode.pb -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

Detailed examples and explanation

MAKE "sum 0 MAKE "i 1 REPEAT 5 [ MAKE "sum :sum + :i MAKE "i :i + 1 ] PRINT :sum

Output 15; exit code 0

PBXB64.exe sum15-logo.logo -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

FORTH

Detailed examples and explanation

5 4 + 3 + 2 + 1 + . \ 15

Output 15; exit code 0

PBXB64.exe sum15-forth.forth -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

SPR

Detailed examples and explanation

VAR.$$SUM=0 FOR.$$III|1|5|1 VIC.$$SUM|$$III NEX. OUT.$$SUM ENR.

Output 15; exit code 0

PBXB64.exe sum15-spr.spr -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

PILOT

Detailed examples and explanation

C: #sum=1+2+3+4+5 T: #sum E:

Output 15; exit code 0

PBXB64.exe sum15-pilot.pil -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

COBOL

Detailed examples and explanation

IDENTIFICATION DIVISION. PROGRAM-ID. QuickSum. DATA DIVISION. WORKING-STORAGE SECTION. 01 TOTAL PIC 9(2). PROCEDURE DIVISION. COMPUTE TOTAL = 1 + 2 + 3 + 4 + 5 DISPLAY TOTAL STOP RUN.

Output 15; exit code 0

PBXB64.exe sum15-cobol.cbl -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source

RUST

Detailed examples and explanation

fn main() -> i64 { let mut sum: i64 = 0; let mut i: i64 = 1; loop { sum = sum + i; if i >= 5 { break; } i = i + 1; } return sum; // 15 }

Exit code 15

PBXB64.exe sum15-rust.rs -O2 -o sum15.exe .\sum15.exe $LASTEXITCODE

Download complete source