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

MULTI-ISA ASSEMBLER

XIRASM

One assembler that writes multiple instruction sets.

Multi-architecture support: assembly for x86, AArch64, RISC-V, and SPIR-V. The compile-time language provides types, functions, and DSLs for batch code generation, executable format implementation, and custom instruction sets — all inside XIRASM, from source to final bytes, with no external toolchain.

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

01 / ASSEMBLY LANGUAGE

Beyond assembly source, modern high-level syntax replaces the old-school macro era.

Processor instructions are written in assembly syntax. Batch generation, data processing, and binary construction go to the compile-time language: write functions, define types, call built-ins — the assembler computes every byte.

01

Familiar instruction syntax

Labels and instructions are written exactly as in the assembly you already know.

02

A complete language at assembly time

Types, functions, control flow, collections, and modules are all available — no more wrestling with nested text macros.

03

Write your own DSLs

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 + MACH-O

02 / MULTI-ISA

Switch instruction sets, keep the way you work.

All four instruction sets share one project model and one compile-time language; each keeps its own syntax and encoding rules, unchanged.

01

x86

NATIVE MACHINE CODE

Generate x86-64 and x86-32 machine code directly — for systems software, tools, and experiments.

X86-64X86-32
02

AArch64

FULL ARM64 ENCODING

From scalar, floating-point, and SIMD to atomic, cryptographic, pointer-authentication, MOPS, and CSSC — modern ARM64 instructions, fully covered.

ARM64NEONMOPS
03

RISC-V

XLEN-AWARE

RV64 and RV32 both assemble with the same language and the same reusable modules.

RV64RV32
04

SPIR-V

GPU IR MODULES

SPIR-V has its own text syntax and word-encoding rules, handled the way GPU IR actually works — not forced into a CPU assembly model.

MODULETEXTWORDS

03 / WHAT YOU CAN BUILD

From instructions to finished binaries, one tool does it all.

Generated tables, wrapped formats, custom images — one language end to end, with output straight to final bytes.

TYPE

Complete compile-time programming

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

FLOW

Reusable DSLs

Wrap complex binary conventions into usable APIs — the APIs are XIRASM source itself, ready to modify and reuse.

DATA

Data-driven generation

Read text, bytes, JSON, and TOML, transform them freely — the binary output is identical every time.

DIAG

Precise binary layout

Regions, labels, alignment, reserves, and fixups are all under direct control, with nothing hidden in the final output.

04 / FORMATS AS XIRASM DSL

Executable formats are implemented as XIRASM DSLs.

PE, COFF, ELF, Mach-O — the whole executable-format library is XIRASM source: use it as is, modify it freely, and follow it to write your own format DSLs. Executables are built by hand from end to end, with zero external tools.

PEWindows executables and DLLsPE32 / PE64
COFFWindows object filesCOFF32 / COFF64
ELFExecutables, PIEs, objects, and shared librariesELF32 / ELF64
MACH-OApple executables and object filesMACH-O 64
APKAndroid packages with a compiled resource table and native librariesZIP / ARSC
RAWFlat and application-specific binariesDIRECT BYTES

06 / XIRASM 0.3.1

Pick your platform and download.

Each assembler archive contains the executable, Apache 2.0 license, include library, tests, 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 / 16.00 MiB
Download
LINUX / X86-64

Linux

Statically linked Linux executable.

TAR.GZ / 17.51 MiB
Download
MACOS / APPLE SILICON

macOS

Native ARM64 executable for Apple Silicon Macs.

TAR.GZ / 15.48 MiB
Download
VS CODE / LSP

VS Code extension

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

VSIX / 1.09 MiB
Download

07 / DOCUMENTATION

Get the examples running first, then go deeper when you need to.

Dedicated guides cover the language, built-in APIs, executable formats, and hand-built binaries.

ONE LANGUAGE / MULTIPLE INSTRUCTION SETS / REAL BINARIES

CPU instructions remain assembly source; everything else is handled by the compile-time language.

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

Open on GitHub