rask-x86_64

Crates.iorask-x86_64
lib.rsrask-x86_64
version0.1.0
created_at2025-10-06 18:11:44.48718+00
updated_at2025-10-06 18:11:44.48718+00
descriptionx86_64 architecture-specific implementation for Rask
homepage
repositoryhttps://github.com/chrischtel/rask
max_upload_size
id1870520
size14,533
Christian Brendlin (chrischtel)

documentation

README

rask-x86_64

x86_64 instruction encoder for the Rask project.

Features

  • Encode x86_64 instructions to machine code bytes
  • Support for MOV, ADD, SUB, RET instructions
  • Proper REX prefix handling for extended registers (R8-R15)
  • Type-safe register and operand system

Example

use rask_x86_64::{encoder::Encoder, registers::Reg64::*, operand::Operand};

let mut encoder = Encoder::new();
encoder.mov(Operand::Reg(RAX), Operand::Imm(1337));
encoder.add(RAX, RBX);
encoder.ret();

let bytes = encoder.bytes(); // Raw x86_64 machine code

Examples

Run the included examples:

cargo run --example basic_encoding
cargo run --example rex_prefixes
cargo run --example arithmetic
Commit count: 0

cargo fmt