| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Original HTTPS Page] |
Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.
You must be logged in to block users.
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abuse简体中文 | Website | What's New
One modern assembler for x86, RISC-V, and SPIR-V. Write real assembly, emit usable binaries, and make the build programmable when you need more.
XIRASM assembles natural ISA text and directly produces flat binaries, Windows PE/COFF, Linux ELF, and complete SPIR-V modules. Start with ordinary assembly. Reach for its typed compile-time language only when a project needs generated code, reusable format logic, or precise binary layout.
Build XIRASM with Zig 0.17:
zig build -Doptimize=ReleaseSafe
Put the resulting xirasm executable on PATH, then create and build a native project:
xirasm init hello --isa x86-64 --os windows --abi msvc
cd hello
xirasm build
For Linux, use --os linux --abi sysv. The generated project contains its source and xirasm.toml, so the next build is just xirasm build.
CLI subcommands precede their options: use xirasm build --timings, not xirasm --timings build.
Labels and processor instructions use their normal text form. Compile-time code appears only where it earns its place:
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);The function and loop run while assembling. The output contains only the machine code and generated data, with no runtime interpreter and no instruction wrapper syntax.
For a minimal flat binary, a source file can be as small as:
x86.use64();
entry:
mov eax, 42
retxirasm hello.asm --target x86-64 -o hello.bin
| CLI target | Output model |
|---|---|
| x86-64, x64, x86_64 | 64-bit x86 instructions and native/flat outputs |
| x86, x86-32 | 32-bit x86 instructions and native/flat outputs |
| rv64, riscv64 | RV64 instructions |
| rv32, riscv32 | RV32 instructions |
| spv, spirv | Complete SPIR-V 1.6 modules |
The same project model and compile-time language apply across targets. You do not have to learn one macro system for x86 and another generation language for RISC-V or SPIR-V.
XIRASM can directly produce:
| Platform or use | Formats |
|---|---|
| Windows | PE32/PE64 executables and DLLs; COFF32/COFF64 objects |
| Linux | ELF32/ELF64 executables; ELF64 PIE and shared libraries; ELF32/ELF64 objects |
| Bare metal and tooling | Flat and application-specific binaries |
| GPU and IR tooling | Complete SPIR-V 1.6 modules |
Normal PE, COFF, and ELF projects use the format library's high-level facades:
import("format/format.inc");When a loader, file format, or research tool needs an unusual layout, the same language also exposes regions, labels, alignment, finalizers, and direct format helpers. The common path stays short; low-level control remains available.
XIRASM's compile-time language is designed for assembly projects that outgrow copy-and-paste and textual substitution:
This makes XIRASM useful for systems programs, executable-format work, embedded binaries, code generators, and instruction-level experiments without turning ordinary instruction text into a programming-language API.
The regression suite checks final encoded bytes and boundary behavior, not only whether source text parses. It includes x86 layout and fixup cases, RISC-V byte comparisons with LLVM tooling, SPIR-V assembly/disassembly and validation, and structural, linker, loader, and native-runtime checks for supported binary formats.
The standalone XIRASM VS Code extension provides highlighting, completion, navigation, and compiler-backed diagnostics.
Current version: 0.2.16
XIRASM is pre-1.0 software. The assembler, language APIs, format library, CLI, and editor support are usable now, while public contracts may still be refined before 1.0.
Apache-2.0.
Standalone Zig ISA backend library for XIRASM: x86/x86-64, RISC-V, and SPIR-V encoders.
Zig
| Back | FazBrowse Home | New Git URL |