Struct burst::x86::X86Operand [] [src]

#[repr(C)]
pub struct X86Operand { pub operand: OperandType, pub components: [OperandType; 2], pub scale: u8, pub size: u16, pub immediate: isize, pub segment: SegmentRegister, }

An operand for an Instruction.

The type of operand is given by the operand member. If the type is OperandType::NONE, none of the other members are defined.

If the operand type is not OperandType::NONE, then the size field is valid.

If the type is OperandType::IMM, then the operand is a constant integer contained in the immediate member.

If the type is OperandType::MEM, then the operand is a memory reference and the other members are used as defined.

The address of a memory reference is effectively the following formula, where references to the component array should look up the current value should look up the current value of the register or substitute zero if the value is OperandType::NONE:

address = components[0] + components[1] * scale + immediate

TODO: Perhaps this should be an enumeration with separate values for invalid, immediate value, a memory reference or a register.

Fields

The type of the operand, a register or one of a set of special values.

The address components of a memory operand.

If this is a memory operand, then this value is used to scale the second component.

The size of the operand in bytes. For register operands, this is the size of the register. For memory operands, this is the size of the memory access.

The value of a constant integer when the operand is the IMM type. When the operand is a memory reference, this contains a constant offset for the memory reference.

The segment register that will be used for a memory access. This will always contain a segment register, as SegmentRegister::DEFAULT is resolved to the default register.

Trait Implementations

impl Debug for X86Operand
[src]

[src]

Formats the value using the given formatter. Read more

impl Operand for X86Operand
[src]

impl Default for X86Operand
[src]

[src]

Returns the "default value" for a type. Read more