PBXB64 Inline Assembly

Native x64 Assembly PBXB64 Addition

Write x64 assembly directly inside PB and B64 programs. Full instruction set support, all general-purpose registers, memory addressing modes, and seamless integration with the compiler's symbol table. The assembler is built-in - no external tools needed.

Inline ASM in PB

PB inline assembly
FUNCTION PBMAIN() AS LONG LOCAL result AS LONG ! mov rax, 42 ! mov result, rax PRINT "Result: "; result ' 42 FUNCTION = 0 END FUNCTION

Prefix assembly lines with ! in PB code. The assembler integrates with the compiler's register allocation and frame layout. All 16 x64 general-purpose registers are available.

Memory Addressing and Labels

Memory ops and labels
FUNCTION PBMAIN() AS LONG LOCAL buffer[4] AS LONG LOCAL i AS LONG ! lea rsi, buffer ! mov rcx, 4 ! xor rax, rax loop_start: ! mov [rsi + rax*4], rax ! inc rax ! cmp rax, rcx ! jl loop_start PRINT "buffer[2] = "; buffer(2) ' 2 FUNCTION = 0 END FUNCTION

Inline ASM supports memory addressing with scale/index/base, local labels, and conditional jumps. The compiler resolves label offsets and integrates with the frame layout.

Inline ASM in B64

B64 asm block
func main() i64 { asm { mov rax, 100 add rax, 50 mov rcx, 25 sub rax, rcx ' rax = 125 } return 0 }

B64 uses asm { ... } blocks for multi-line assembly. All x64 instructions, registers, and addressing modes are supported. The block is passed directly to the integrated assembler.

Standalone ASM Files

Pure assembly compilation
REM Compile standalone .asm file PBXB64 add_two.asm -o add_two.exe add_two.exe REM Assembly with C source PBXB64 main.c helper.asm -o program.exe

PBXB64 can compile standalone .asm files directly. The assembler produces COFF objects that link with C, PB, and B64 code. Full x64 instruction set with MASM-style syntax.

Back to feature list