XIRASM 0.2.7
Source
XIRASM source and assembled byte trace on a phosphor terminal

MODERN MULTI-ISA ASSEMBLER

XIRASM

One assembler. Multiple instruction sets.

Write x86, RISC-V, and SPIR-V with one modern language. Keep familiar instruction syntax, then use typed functions, control flow, collections, and modules to build format DSLs and complex binaries.

X86 / 32 + 64 RISC-V / RV32 + RV64 SPIR-V / MODULE + TEXT FORMAT DSL / PE + COFF + ELF

01 / MODERN ASSEMBLY LANGUAGE

Keep the instructions. Replace the macro era.

Use assembly syntax for actual instructions and a modern compile-time language for repetition, abstraction, data processing, and binary construction.

01

Familiar instruction syntax

Write labels and processor instructions the way assembly programmers expect.

02

A real language at assembly time

Types, functions, control flow, collections, and modules replace fragile text-macro puzzles.

03

DSLs, not directive tricks

Create reusable languages for formats, tables, protocols, firmware images, and project-specific rules.

SOURCE / TABLE.ASM OUTPUT / 22 BYTES
x86.use64();

fn emit_square_table(count: u8) {
    for value in range(0, count) {
        dd(value * value);
    }
}

const answer: u32 = 40 + 2;

entry:
    mov eax, answer
    ret

table:
emit_square_table(4);
FORMAT DSLPE + COFF + ELF

02 / MULTI-ISA

Change the ISA, not the way you build.

One project model and one compile-time language span x86, RISC-V, and SPIR-V while preserving what makes each instruction family different.

01

x86

NATIVE MACHINE CODE

Build x86-64 and x86-32 machine code for systems software, tools, experiments, executables, and object files.

X86-64X86-32
02

RISC-V

XLEN-AWARE

Assemble RV64 and RV32 instruction text with the same modern language, reusable modules, and data-generation tools.

RV64RV32
03

SPIR-V

GPU IR MODULES

Build SPIR-V modules and instruction streams with dedicated text and word encoding instead of forcing GPU IR into a CPU-style mode.

MODULETEXTWORDS

03 / WHAT YOU CAN BUILD

More than instructions: build the whole binary.

Use one language from instruction streams to generated tables, reusable DSLs, executable formats, and custom binary images.

TYPE

Modern compile-time programming

Types, functions, control flow, strings, bytes, structs, unions, lists, and maps.

FLOW

Reusable DSLs

Package complex binary conventions behind readable APIs written in XIRASM itself.

DATA

Data-driven generation

Read text, bytes, JSON, and TOML, transform the data, then emit deterministic binary output.

DIAG

Precise binary layout

Control regions, labels, alignment, reserves, fixups, and finalization without hiding the bytes.

04 / FORMATS AS XIRASM DSL

Executable formats are written in XIRASM itself.

PE, COFF, and ELF are not opaque built-ins. The format library is XIRASM source you can use directly, study, extend, or follow to build your own format DSL.

PEWindows executables and DLLsPE32 / PE64
COFFWindows object filesCOFF32 / COFF64
ELFExecutables, PIEs, objects, and shared librariesELF32 / ELF64
RAWFlat and application-specific binariesDIRECT BYTES

05 / DOCUMENTATION

Start from working examples, then go as deep as you need.

The guides cover the modern language, built-in APIs, executable formats, and direct binary construction.

ONE LANGUAGE / MULTIPLE ISAS / REAL BINARIES

Write instructions like assembly. Build everything else with modern syntax.

From machine code to reusable format DSLs, XIRASM keeps the source readable and the output under your control.

Open on Codeberg