1
2
Fork
You've already forked asmkit
2
Assembler toolkit: encoding and decoding of various architectures
  • Rust 89.5%
  • C 7.6%
  • Python 2.9%
2026年03月15日 08:34:02 +07:00
benches feat(x86): dyn emit and parsing 2026年03月09日 13:26:20 +07:00
examples rewrite arm64; remove disasm; proper feature gates 2026年03月13日 14:51:46 +07:00
meta slight improvements to risc-v 2026年03月14日 12:43:30 +07:00
src cleanup 2026年03月15日 08:33:52 +07:00
.gitignore hot patch 2026年03月06日 15:12:05 +07:00
.gitmodules riscv labels 2024年10月26日 22:43:03 +07:00
Cargo.lock bump version 2026年03月15日 08:34:02 +07:00
Cargo.toml bump version 2026年03月15日 08:34:02 +07:00
LICENSE license finally 2026年03月06日 15:26:59 +07:00
PORTING.md add relocations 2024年11月12日 22:07:48 +07:00
README.md rewrite arm64; remove disasm; proper feature gates 2026年03月13日 14:51:46 +07:00

asmkit

#![no_std] assembler library.

Features

  • X64, RISC-V, PPC, and ARM (WIP) assemblers
  • Small and portable library.
  • Tiny amount of dependencies:
    • libc, intrusive-collections: for JIT support
    • paste, derive-more: makes our life simpler when declaring arch-specific stuff over and over
    • smallvec: for code generation to not heap allocate often
  • Relocations are provided by CodeBuffer interface and assembler will use them if you use symbols in API.

Goals

  • Auto-generated assemblers for as many as possible platform.
  • Portability: library should built & run on any platform (even if it does not provide assembler for one), and assemblers on its own must not be dependent on platform we built asmkit on.

TODO

  • (削除) Add support for ARM64 (削除ここまで) Works! Not everything is tested, so if errors occur please open an issue.
  • Add support for PPC64
  • Add support for OpenPOWER (POWER9/POWER10)
  • Add support for RW info and implicit operand info for all opcodes
  • Cross-platform helpers to perform calls
  • JSC/SpiderMonkey-like MacroAssembler to help generate assembly without worrying about target architecture
  • Compiler/Builder interface: emit instructions as Inst structure and allow modifying them before emitting, and also possibly to have regalloc pass over them.

Related projects

  • AsmJit: Core API, JIT API, AArch64 backend and operands are ported from AsmJit, the overall idea of making portable assembler in Rust comes from AsmJit
  • fadec: x86/64 encoding/decoding library. We use opcode tables provided by fadec for x86/64 support and encode.c is partially used for emitting code.
  • riscv-opcodes: Opcode table for RISC-V, used to generate RISC-V assembler/disassembler.
  • GDB: GDB is a debugger but we use its ppc-opc.c as an opcode table for PowerPC support.