XED
|
Memory Displacement | |
static XED_INLINE xed_enc_displacement_t | xed_disp (xed_uint64_t displacement, xed_uint32_t displacement_width) |
a memory displacement (not for branches) More... | |
Branch Displacement | |
static XED_INLINE xed_encoder_operand_t | xed_relbr (xed_int32_t brdisp, xed_uint_t width) |
a relative branch displacement operand More... | |
Pointer Displacement | |
static XED_INLINE xed_encoder_operand_t | xed_ptr (xed_int32_t brdisp, xed_uint_t width) |
a relative displacement for a PTR operand – the subsequent imm0 holds the 16b selector More... | |
Register and Immmediate Operands | |
static XED_INLINE xed_encoder_operand_t | xed_reg (xed_reg_enum_t reg) |
a register operand More... | |
static XED_INLINE xed_encoder_operand_t | xed_imm0 (xed_uint64_t v, xed_uint_t width) |
a first immediate operand (known as IMM0) More... | |
static XED_INLINE xed_encoder_operand_t | xed_simm0 (xed_int32_t v, xed_uint_t width) |
an 32b signed immediate operand More... | |
static XED_INLINE xed_encoder_operand_t | xed_imm1 (xed_uint8_t v) |
an second immediate operand (known as IMM1) More... | |
static XED_INLINE xed_encoder_operand_t | xed_other (xed_operand_enum_t operand_name, xed_int32_t value) |
an operand storage field name and value More... | |
Instruction Properties and prefixes | |
static XED_INLINE void | xed_addr (xed_encoder_instruction_t *x, xed_uint_t width) |
This is to specify effective address size different than the default. More... | |
static XED_INLINE void | xed_rep (xed_encoder_instruction_t *x) |
static XED_INLINE void | xed_repne (xed_encoder_instruction_t *x) |
static XED_INLINE void | xed_lock (xed_encoder_instruction_t *x) |
XED_DLL_EXPORT xed_bool_t | xed_convert_to_encoder_request (xed_encoder_request_t *out, xed_encoder_instruction_t *in) |
convert a xed_encoder_instruction_t to a xed_encoder_request_t for encoding More... | |
This is a higher level API for encoding instructions.
A full example is present in examples/xed-ex5-enc.c
In the following example we create one instructions template that can be passed to the encoder.
The high-level encoder interface allows passing the effective operand width for the xed_inst*() function as 0 (zero) when the effective operand width is the default.
The default width in 16b mode is 16b. The default width in 32b or 64b modes is 32b. So if you do a 16b operation in 32b/64b mode, you must set the effective operand width. If you do a 64b operation in 64b mode, you must set it (the default is 32). Or if you do a more rare 32b operation in 16b mode you must also set it.
When all the operands are "suppressed" operands, then the effective operand width must be supplied for nondefault operation widths.
|
static |
This is to specify effective address size different than the default.
For things with base or index regs, XED picks it up from the registers. But for things that have implicit memops, or no base or index reg, we must allow the user to set the address width directly.
Definition at line 380 of file xed-encoder-hl.h.
XED_DLL_EXPORT xed_bool_t xed_convert_to_encoder_request | ( | xed_encoder_request_t * | out, |
xed_encoder_instruction_t * | in | ||
) |
convert a xed_encoder_instruction_t to a xed_encoder_request_t for encoding
|
static |
a memory displacement (not for branches)
Definition at line 52 of file xed-encoder-hl.h.
|
static |
a first immediate operand (known as IMM0)
Definition at line 149 of file xed-encoder-hl.h.
|
static |
an second immediate operand (known as IMM1)
Definition at line 174 of file xed-encoder-hl.h.
|
static |
instruction with an array of operands.
The maximum number is XED_ENCODER_OPERANDS_MAX. The array's contents are copied.
Definition at line 553 of file xed-encoder-hl.h.
|
static |
instruction with no operands
Definition at line 424 of file xed-encoder-hl.h.
|
static |
instruction with one operand
Definition at line 440 of file xed-encoder-hl.h.
|
static |
instruction with two operands
Definition at line 458 of file xed-encoder-hl.h.
|
static |
instruction with three operands
Definition at line 478 of file xed-encoder-hl.h.
|
static |
instruction with four operands
Definition at line 501 of file xed-encoder-hl.h.
|
static |
instruction with five operands
Definition at line 525 of file xed-encoder-hl.h.
|
static |
Definition at line 397 of file xed-encoder-hl.h.
|
static |
memory operand - base only
Definition at line 223 of file xed-encoder-hl.h.
|
static |
memory operand - base and displacement only
Definition at line 239 of file xed-encoder-hl.h.
|
static |
memory operand - base, index, scale, displacement
Definition at line 255 of file xed-encoder-hl.h.
|
static |
memory operand - segment and base only
Definition at line 274 of file xed-encoder-hl.h.
|
static |
memory operand - segment, base and displacement only
Definition at line 291 of file xed-encoder-hl.h.
|
static |
memory operand - segment, base, index, scale, and displacement
Definition at line 324 of file xed-encoder-hl.h.
|
static |
memory operand - segment and displacement only
Definition at line 308 of file xed-encoder-hl.h.
|
static |
an operand storage field name and value
Definition at line 185 of file xed-encoder-hl.h.
|
static |
a relative displacement for a PTR operand – the subsequent imm0 holds the 16b selector
Definition at line 125 of file xed-encoder-hl.h.
|
static |
a register operand
Definition at line 139 of file xed-encoder-hl.h.
|
static |
a relative branch displacement operand
Definition at line 110 of file xed-encoder-hl.h.
|
static |
Definition at line 387 of file xed-encoder-hl.h.
|
static |
Definition at line 392 of file xed-encoder-hl.h.
|
static |
seg reg override for implicit suppressed memory ops
Definition at line 205 of file xed-encoder-hl.h.
|
static |
seg reg override for implicit suppressed memory ops
Definition at line 214 of file xed-encoder-hl.h.
|
static |
an 32b signed immediate operand
Definition at line 159 of file xed-encoder-hl.h.