Expand description

Module to help people generate x86_64 code in Rust

Inspired from https://www.lri.fr/~filliatr/ens/compil/lib/x86_64.ml.html

This crate wants to be an equivalent of the above code

Modules

Define data segment
Define structure for whole file
Defines registers and operands

Macros

Create an Operand (for any type R) to access memory
Macro to convert an element of type R with the trait Reg to an element of type Operand

Enums

Data structure representing assembly

Constants

8-bits registers (1 byte)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)
8-bits registers (1 byte)
16-bits registers (2 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
32-bits registers (4 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
8-bits registers (1 byte)
32-bits registers (4 bytes)
16-bits registers (2 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
64-bits registers (8 bytes)
16-bits registers (2 bytes)
8-bits registers (1 byte)
16-bits registers (2 bytes)
8-bits registers (1 byte)

Functions

$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
Call label
Call address
sign extend EAX into EDX::EAX
Conditional move of 4-bytes operands
Conditional move of 8-bytes operands
Conditional move of 2-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
Add comment to Assembly (should not contain de line break!)
sign extend RAX into RDX::RAX
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
Immediate operand for 8-bits instructions
Immediate operand for 32-bits instructions
Operands Immediate operand for 64-bits instructions
Immediate operand for 16-bits instructions
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
Conditional jump if above equal
Conditional jump
Jump to label
Jump to address
Conditional jump if not zero
Conditional jump if zero
Place a label
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
Leave instruction
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
nop instruction (does nothing)
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
Pop 8-bytes from stack
Push 8-bytes on stack
Equivalent to popq %rip
Conditionnal set
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands
$op instructions between 8-bytes operands
$op instructions between 2-bytes operands
$op instructions between 1-bytes operands
$op instructions between 4-bytes operands