Zydis: ZydisEncodableInstruction_ Struct Reference

Zydis v4.0.0

Loading...
Searching...
No Matches
Public Member Functions | Data Fields
ZydisEncodableInstruction_ Struct Reference

This structure is encoder's internal representation of encodable instruction definition. More...

`#include <EncoderData.h>`

## Public Member Functions
ZyanU8 encoding | ZYAN_BITFIELD (ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS)
| The instruction-encoding.
ZyanU8 opcode_map | ZYAN_BITFIELD (ZYDIS_OPCODE_MAP_REQUIRED_BITS)
| The opcode map.
ZyanU8 modes | ZYAN_BITFIELD (ZYDIS_WIDTH_REQUIRED_BITS)
| The combination of allowed processor modes.
ZyanU8 address_sizes | ZYAN_BITFIELD (ZYDIS_WIDTH_REQUIRED_BITS)
| The combination of allowed address sizes.
ZyanU8 operand_sizes | ZYAN_BITFIELD (ZYDIS_WIDTH_REQUIRED_BITS)
| The combination of allowed operand sizes.
ZyanU8 mandatory_prefix | ZYAN_BITFIELD (ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS)
| The mandatory prefix.
ZyanU8 rex_w | ZYAN_BITFIELD (1)
| True if `REX.W` is required for this definition.
ZyanU8 vector_length | ZYAN_BITFIELD (ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS)
| The vector length.
ZyanU8 accepts_hint | ZYAN_BITFIELD (ZYDIS_SIZE_HINT_REQUIRED_BITS)
| The accepted sizing hint.
ZyanU8 swappable | ZYAN_BITFIELD (1)
| Indicates that next instruction definition can be safely used instead of current one.

## Data Fields
ZyanU16 | instruction_reference
| Index to one of decoder's instruction definition arrays.
ZyanU16 | operand_mask
| Compressed information about operand count and types.
ZyanU8 | opcode
| The instruction-opcode.
ZyanU8 | modrm
| The mandatory ModR/M value.

## Detailed Description

This structure is encoder's internal representation of encodable instruction definition.

## Member Function Documentation

## ◆ ZYAN_BITFIELD()

ZyanU8 swappable ZYAN_BITFIELD | ( | 1 |  | ) |

Indicates that next instruction definition can be safely used instead of current one.

This is used with some `VEX` instructions to take advantage of 2-byte `VEX` prefix when possible. 2-byte `VEX` allows to use high registers only when operand is encoded in `modrm_reg` (high bit in `REX.R`). Encoder uses swappable definitions to take advantage of this optimization opportunity.

Second use of this field is to handle special case for `mov` instruction. This particular conflict is described in detail inside `ZydisHandleSwappableDefinition`.

## Field Documentation

## ◆ operand_mask

ZyanU16 operand_mask

Compressed information about operand count and types.

Operand count is stored in lowest bits. Types of subsequent operands are stored in higher bits.

The documentation for this struct was generated from the following file:

- include/Zydis/Internal/EncoderData.h