Zydis: ZydisEncodableInstruction_ Struct Reference

Zydis v4.1.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() [1/10]

ZyanU8 rex_w ZYAN_BITFIELD | ( | 1 |  | ) |

True if `REX.W` is required for this definition.

## ◆ ZYAN_BITFIELD() [2/10]

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`.

## ◆ ZYAN_BITFIELD() [3/10]

ZyanU8 encoding ZYAN_BITFIELD | ( | ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS |  | ) |

The instruction-encoding.

## ◆ ZYAN_BITFIELD() [4/10]

ZyanU8 mandatory_prefix ZYAN_BITFIELD | ( | ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS |  | ) |

The mandatory prefix.

## ◆ ZYAN_BITFIELD() [5/10]

ZyanU8 vector_length ZYAN_BITFIELD | ( | ZYDIS_MANDATORY_PREFIX_REQUIRED_BITS |  | ) |

The vector length.

## ◆ ZYAN_BITFIELD() [6/10]

ZyanU8 opcode_map ZYAN_BITFIELD | ( | ZYDIS_OPCODE_MAP_REQUIRED_BITS |  | ) |

The opcode map.

## ◆ ZYAN_BITFIELD() [7/10]

ZyanU8 accepts_hint ZYAN_BITFIELD | ( | ZYDIS_SIZE_HINT_REQUIRED_BITS |  | ) |

The accepted sizing hint.

## ◆ ZYAN_BITFIELD() [8/10]

ZyanU8 modes ZYAN_BITFIELD | ( | ZYDIS_WIDTH_REQUIRED_BITS |  | ) |

The combination of allowed processor modes.

## ◆ ZYAN_BITFIELD() [9/10]

ZyanU8 address_sizes ZYAN_BITFIELD | ( | ZYDIS_WIDTH_REQUIRED_BITS |  | ) |

The combination of allowed address sizes.

## ◆ ZYAN_BITFIELD() [10/10]

ZyanU8 operand_sizes ZYAN_BITFIELD | ( | ZYDIS_WIDTH_REQUIRED_BITS |  | ) |

The combination of allowed operand sizes.

## Field Documentation

## ◆ instruction_reference

ZyanU16 instruction_reference

Index to one of decoder's instruction definition arrays.

## ◆ modrm

ZyanU8 modrm

The mandatory ModR/M value.

## ◆ opcode

ZyanU8 opcode

The instruction-opcode.

## ◆ 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