Home › Language Frontends › PILOT Frontend › Overview PBXB64 Compiler Help

PBXB64 - PILOT Language Reference

PILOT is an educational programming language supported by PBXB64 via standalone .pil files. The compiler produces native Windows x64 executables from PILOT source code through the unified IR backend.

Chapter: Overview

Description

PILOT is an educational programming language supported by PBXB64 via standalone .pil files. The compiler produces native Windows x64 executables from PILOT source code through the unified IR backend.

File Extension: Save PILOT programs with the .pil extension. Compile with PBXB64 program.pil -o program.exe.

Implemented Commands

CommandDescriptionStatus
R:Remark (comment). Ignored by the compiler.Full
T:Type text. Supports string literals, $variables, and multi-part comma-separated literals.Full
E:End program. Returns 0 from the entry point.Full
C:Compute / assign. C: $var = "string" or C: #var = number.Full
A:Accept a complete line into $var or a signed 64-bit integer into #var.Full
J:Jump unconditionally to *label.Full
M:Match conditional jump. Jumps to *label if match slot is true.Full
Y:Yes guard. Execute next line only if match slot is true.Full
N:No guard. Execute next line only if match slot is false.Full
U:Call *label as a subroutine. Calls may nest; E: returns to the most recent caller.Full
S:Invoke the Windows sound/beep runtime helper.Full
V:Bind a PILOT variable to a PowerBASIC GLOBAL in both directions.Full
*labelLabel definition for J:, M:, and U: targets.Full

Variable Types

PrefixTypeExample
$String variable$name, $message
#Number variable (64-bit signed integer)#count, #age

Match Slot

The match slot is an internal boolean flag used by Y:, N:, and M: commands:

Number Expressions

The C: command for number variables supports:

Boundary: Floating point, parentheses, arrays, and general BASIC expressions are outside the documented PILOT arithmetic surface.

Text Expressions

The T: and C: commands for strings support:

Limitation: Mixed multi-part text (literals combined with variables) is not yet supported.

PowerBASIC Variable Bridge

V: #LOCAL|pb_global_name|QUAD
V: $LOCAL|pb_global_name|STRING

Reads import the current PB GLOBAL value. Assignments and accepted input export immediately. Multiple PILOT aliases may bind to the same PB global.

Link requirement: Pass the PowerBASIC source defining the named GLOBAL as an additional compiler input. The prefix and bridge type must match.

Entry Point

PILOT programs compile to a pilot_main function returning a 64-bit integer. The E: command emits return 0. If no E: is present, the compiler adds an implicit return at the end.

Testing

The current qualification contains 31 link/run cases plus one code-generation route gate.

Example

T: "Hello from PILOT"
E: