Expand description
x86-64 instruction encoder (REX, ModR/M, SIB, immediate, relocation). x86-64 instruction encoder.
Encodes parsed Instructions into machine-code bytes.
Uses a table-driven approach for opcode lookup with manual
ModR/M, SIB, REX prefix construction.
Structs§
- Encoded
Instr - Result of encoding a single instruction.
- Instr
Bytes - Stack-allocated instruction byte buffer — eliminates per-instruction heap allocation on the encoding hot path.
- Relax
Info - Information for branch relaxation — allows the linker to try a shorter encoding.
- Relocation
- A relocation record for unresolved labels.
Enums§
- Reloc
Kind - How the linker should patch the relocation target into the instruction.
Functions§
- encode_
instruction - Errors
- encode_
instruction_ 16 - x86-16 (real mode) encoder.