Dynasm-rs

In the search for faster interpreters, Just-In-Time compilation is often a useful tool. This compiler extension attempts to make the writing of such programs easier and faster.

At its core, dynasm-rs is an assembler compiler. It reads assembly templates which it then compiles into code that when executed will result in the proper machine code being emitted.

Dynasm is split up into two parts. The first is the compiler extension that performs the translation of assembly templates into rust code, the second part is a small runtime that handles the generation of the wanted machine code.

Dynasm-rs supports the x86, x64 and aarch64 instruction set architectures.

Dynasm-rs is inspired by the LuaJIT DynASM project for C and C++.

Documentation

The documentation of dynasm-rs is split up into several parts. To get started, you’re advised to read through the tutorial. After this, you can read through the language reference to learn about the syntax used by dynasm-rs. You can also read through the runtime documentation to learn about the runtime API. The instruction references lists all assembly mnemnonics and formats supported by dynasm-rs. Finally, documentation on the internals on dynasm-rs can be browsed here.

Differences from LuaJit Dynasm

The following list summarizes some of the larger differences between LuaJIT dynasm and dynasm-rs.

general

x64/x86

aarch64