XIRASM 0.2.15
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 / RELEASE NOTES

Changes you can use.

Release notes track user-facing language, library, tooling, and documentation changes so you can quickly judge each update.

0.2.15 UPDATE LANGUAGE / X86

Constant immediates and multiline parameters fixed.

Constant expressions now resolve correctly when used as x86 immediate operands, and function declarations can split parameter lists across multiple lines.

VIEW CHANGE
0.2.15 UPDATE EXPERIMENTAL IO LIBRARY

Buffered streams move data faster.

Bulk stream write, read, and flush paths now use compact x86-64 block copies. The public IO surface and ABI behavior remain unchanged.

  • 01 / THROUGHPUT

    Faster buffered transfers

    Measured 64 to 4096 byte copies improved by roughly 2.5 to 50 times on a Ryzen 5 5600.

  • 02 / CODE SIZE

    Smaller generated loops

    Each stream expansion emits about 17 fewer bytes by replacing byte-at-a-time loops with rep movsb.

  • 03 / USAGE

    Keep byte operations for single bytes

    Use io_stream_write_byte and io_stream_read_byte for one-byte operations. The IO library remains experimental.

0.2.15 FORMAT DSL / WIN32 / DOCUMENTATION

Executable formats, without the ceremony.

XIRASM 0.2.15 focuses on the format DSL, Win32 development support, and shorter practical documentation. ISA encoders and the assembler core remain unchanged.

  • 01 / FORMAT DSL

    Executable formats start with a mutable plan

    PE, COFF, and ELF now use direct mutable plans. Batch imports and exports replace image0/image1 chains and repeated const rebinding, while Win32 API selections plug directly into PE imports.

  • 02 / WIN32 SDK

    Win32, GUID, and COM support is built in

    Partitioned includes provide 339 DLLs, 17,105 APIs, 93,534 constants, and 21,717 ABI aggregate types. Structures preserve signed fields; GUID, IID, CLSID bytes, and COM vtable offsets are ready to use.

  • 03 / TUTORIAL

    Five practical chapters replace the large format manual

    Start with template choice, PE, ELF, object files, and common rules. Advanced construction remains separate for users who need direct control.

06 / XIRASM 0.2.15

Choose your platform. Keep the package lean.

Each assembler archive contains the executable, Apache 2.0 license, include library, and current English and Chinese documentation. The VS Code package adds editor support and the language server.

WINDOWS / X86-64

Windows

Native Windows console executable.

ZIP / 15.28 MB
Download
LINUX / X86-64

Linux

Statically linked Linux executable.

TAR.GZ / 14.54 MB
Download
VS CODE / LSP

VS Code extension

Syntax, diagnostics, completion, hover, and language server.

VSIX / 885 KB
Download

07 / 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 GitHub