Skip to main content

Crate binbun_x86

Crate binbun_x86 

Source
Expand description

x86 and x86-64 instruction decoder.

The tables in generated/ are produced by cargo xtask codegen from Intel XED’s datafiles (third_party/xed); the decoding logic around them is written by hand. The crate is no_std; its only dependency is binbun_isa, whose traits it implements (X86) and whose control-flow vocabulary Instruction::flow returns.

Structs§

Attributes
A set of Attributes.
CpuidField
Bits low..=high of register from CPUID leaf leaf, subleaf subleaf, which must equal value.
Decoder
Decodes the instructions of a buffer one after another (a linear sweep).
FlagEffect
One flag and what happens to it.
FlagSet
A set of flags, laid out as in RFLAGS (the x87 condition codes in bits 28 to 31, which RFLAGS does not use).
Flags
An instruction’s effect on the flags.
Instruction
A decoded instruction.
Intel
An instruction in Intel syntax, at an address (for branch targets).
Memory
A memory operand (or an address computation, LEA).
Operand
An operand of a decoded instruction.
UnknownName
Error of parsing a name that names nothing.
X86
The x86 instruction set (16, 32 and 64-bit), for analyses written against binbun_isa::Architecture.

Enums§

Action
How an instruction accesses an operand.
Attribute
A property of instructions (XED’s attributes).
Category
A broad kind of instruction (XED’s categories).
Condition
The condition an instruction tests.
CpuidRegister
A CPUID output register.
DecodeError
Why bytes do not decode to an instruction. The variants follow XED’s xed_error_enum_t.
ElementBase
The kind of an operand’s elements.
ElementType
An operand’s element type (XED’s xtype).
Encoding
An instruction’s prefix family.
Extension
The ISA extension an instruction belongs to.
Flag
A flag of RFLAGS, or an x87 condition code.
FlagAction
What an instruction does to a flag.
Form
An instruction form: a mnemonic with one kind of operands, as XED names it (its iform), e.g. MOV_GPRv_MEMv.
IsaSet
The CPUID-detectable feature set an instruction needs (XED’s ISA sets).
Mnemonic
An instruction’s operation, as XED classifies it (its iclass).
Mode
The processor mode instructions are decoded for.
OperandName
An operand’s name: which decoder field holds its value (XED’s xed_operand_enum_t).
OperandWidth
An operand width code (XED’s xed_operand_width_enum_t): the operand’s size, often depending on the effective operand size.
Register
A register, including XED’s pseudo registers (stack pointer updates, x87 status words, MSRs) that instructions use implicitly.
RegisterClass
The kind of a Register.
Value
The decoded value of an operand.
Visibility
Whether an operand appears in assembly.

Constants§

MAX_LENGTH
The longest x86 instruction.
MAX_OPERANDS
Most operands an instruction has: the longest Instruction::operands.

Functions§

decode
Decodes the instruction at the start of bytes.
decode_flow
What control-flow recovery needs of the instruction at the start of bytes, which is at address: FlowStep::of the decoded instruction, without decoding what flow does not depend on where the 64-bit fast path applies.
decode_length
Decodes the length of the instruction at the start of bytes.
relative_target
The address displacement from the end of instruction at address, wrapped as the instruction pointer wraps (XED’s print_rel_sym): to 16 bits with a 16-bit operand size (except XBEGIN), else to the mode’s width.