OpCodeInfo¶
- class iced_x86.OpCodeInfo(code)¶
Opcode info, returned by
Instruction.op_codeor created by the constructor- Parameters:
code (
Code) – Code value
Examples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.op_code_string == "EVEX.256.66.0F.W1 28 /r" assert op_code.encoding == EncodingKind.EVEX assert OpCodeInfo(Code.SUB_R8_RM8).op_code == 0x2A assert OpCodeInfo(Code.CVTPI2PS_XMM_MMM64).op_code == 0x2A
- amd_lock_reg_bit¶
Trueif theLOCKprefix can be used as an extra register bit (bit 3) to access registers 8-15 without aREXprefix (eg. in 32-bit mode)- Type:
- broadcast_memory_size¶
If it has a memory operand, gets the
MemorySize(broadcast memory type)- Type:
- can_broadcast¶
(EVEX)
Trueif the instruction supports broadcasting (EVEX.bbit) (if it has a memory operand)- Type:
- can_suppress_all_exceptions¶
(EVEX/MVEX)
Trueif the instruction supports suppress all exceptions- Type:
- can_use_hint_taken_prefix¶
Trueif theHINT-TAKEN(3E) andHINT-NOT-TAKEN(2E) prefixes can be used- Type:
- can_use_zeroing_masking¶
(EVEX)
Trueif the instruction supports zeroing masking (if one of the opmask registersK1-K7is used and destination operand is not a memory operand)- Type:
- code¶
Gets the code (a
Codeenum value)Examples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.code == Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256
- Type:
- decoder_option¶
Gets the decoder option that’s needed to decode the instruction or
DecoderOptions.NONE.- Type:
- default_op_size64¶
Trueif the default operand size is 64 in 64-bit mode. A66prefix can switch to 16-bit operand size.- Type:
- encoding¶
Gets the encoding (an
EncodingKindenum value)Examples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.encoding == EncodingKind.EVEX
- Type:
- force_op_size64¶
Trueif the operand size is always 64 in 64-bit mode. A66prefix is ignored.- Type:
- group_index¶
(
i8) Group index (0-7) or -1. If it’s 0-7, it’s stored in theregfield of themodrmbyte.- Type:
- ignores_segment¶
Trueif the instruction doesn’t read the segment register if it uses a memory operand- Type:
- instruction_string¶
Gets the instruction string, eg.
VPBROADCASTB xmm1, xmm2/m8, see alsoOpCodeInfo.op_code_stringExamples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.instruction_string == "VMOVAPD ymm1 {k1}{z}, ymm2/m256"
- Type:
- intel_force_op_size64¶
Trueif the Intel decoder forces 64-bit operand size. A66prefix is ignored.- Type:
- intel_smm_vm_exit¶
(Intel VMX)
Trueif it causes an SMM VM exit in VMX root operation (if dual-monitor treatment is activated)- Type:
- is_available_in_mode(bitness)¶
Checks if the instruction is available in 16-bit mode, 32-bit mode or 64-bit mode
- is_input_output¶
Trueif the instruction accesses the I/O address space (eg.IN,OUT,INS,OUTS)- Type:
- is_instruction¶
Trueif it’s an instruction,Falseif it’s eg.Code.INVALID,db,dw,dd,dq,zero_bytesExamples:
from iced_x86 import * assert OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256).is_instruction assert not OpCodeInfo(Code.INVALID).is_instruction assert not OpCodeInfo(Code.DECLAREBYTE).is_instruction
- Type:
- is_lig¶
(VEX/XOP/EVEX)
Trueif theL/L'Lfields are ignored.EVEX: if reg-only ops and
{er}(EVEX.bis set),L'Lis the rounding control and not ignored.- Type:
- is_nop¶
Trueif it’s one of the many nop instructions (does not include FPU nop instructions, eg.FNOP)- Type:
- is_op_mask_read_write¶
Trueif the opmask register is read and written (instead of just read). This also implies that it can’t beK0.- Type:
- is_privileged¶
Trueif it’s a privileged instruction (all CPL=0 instructions (exceptVMCALL) and IOPL instructionsIN,INS,OUT,OUTS,CLI,STI)- Type:
- is_reserved_nop¶
Trueif it’s one of the many reserved nop instructions (eg.0F0D,0F18-0F1F)- Type:
- is_stack_instruction¶
Trueif it’s an instruction that implicitly uses the stack register, eg.CALL,POP, etc- Type:
- is_wig32¶
(VEX/XOP/EVEX/MVEX)
Trueif theWfield is ignored in 16/32-bit modes (but not 64-bit mode)- Type:
- l¶
(
u8) (VEX/XOP/EVEX)L/L'Lvalue or default value ifOpCodeInfo.is_ligisTrue- Type:
- mandatory_prefix¶
Gets the mandatory prefix (a
MandatoryPrefixenum value)- Type:
- may_require_cpl0¶
Trueif the instruction requires either CPL=0 or CPL<=3 depending on some CPU option (eg.CR4.TSD,CR4.PCE,CR4.UMIP)- Type:
- memory_size¶
If it has a memory operand, gets the
MemorySize(non-broadcast memory type)- Type:
- mnemonic¶
Gets the mnemonic (a
Mnemonicenum value)Examples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.mnemonic == Mnemonic.VMOVAPD
- Type:
- mvex_can_use_eviction_hint¶
(MVEX)
Trueif the instruction supports eviction hint (if it has a memory operand)- Type:
- mvex_can_use_imm_rounding_control¶
(MVEX)
Trueif the instruction’s rounding control bits are stored inimm8[1:0]- Type:
- mvex_conversion_func¶
(MVEX) Gets the conversion function, eg.
Sf32(anMvexConvFnenum value)- Type:
- mvex_eh_bit¶
(MVEX) Gets the
EHbit that’s required to encode this instruction (anMvexEHBitenum value)- Type:
- mvex_ignores_op_mask_register¶
(MVEX)
Trueif the instruction ignores op mask registers (eg.{k1})- Type:
- mvex_tuple_type_lut_kind¶
(MVEX) Gets the tuple type / conv lut kind (an
MvexTupleTypeLutKindenum value)- Type:
- mvex_valid_conversion_funcs_mask¶
(
u8) (MVEX) Gets flags indicating which conversion functions are valid (bit 0 == func 0)- Type:
- mvex_valid_swizzle_funcs_mask¶
(
u8) (MVEX) Gets flags indicating which swizzle functions are valid (bit 0 == func 0)- Type:
- op0_kind¶
Gets operand #0’s opkind (an
OpCodeOperandKindenum value)- Type:
- op1_kind¶
Gets operand #1’s opkind (an
OpCodeOperandKindenum value)- Type:
- op2_kind¶
Gets operand #2’s opkind (an
OpCodeOperandKindenum value)- Type:
- op3_kind¶
Gets operand #3’s opkind (an
OpCodeOperandKindenum value)- Type:
- op4_kind¶
Gets operand #4’s opkind (an
OpCodeOperandKindenum value)- Type:
- op_code¶
(
u32) Gets the opcode byte(s). The low byte(s) of this value is the opcode. The length is inOpCodeInfo.op_code_len. It doesn’t include the table value, seeOpCodeInfo.table.Examples:
from iced_x86 import * assert OpCodeInfo(Code.FFREEP_STI).op_code == 0xDFC0 assert OpCodeInfo(Code.VMRUNW).op_code == 0x01D8 assert OpCodeInfo(Code.SUB_R8_RM8).op_code == 0x2A assert OpCodeInfo(Code.CVTPI2PS_XMM_MMM64).op_code == 0x2A
- Type:
- op_code_len¶
(
u8) Gets the length of the opcode bytes (OpCodeInfo.op_code). The low bytes is the opcode value.Examples:
from iced_x86 import * assert OpCodeInfo(Code.FFREEP_STI).op_code_len == 2 assert OpCodeInfo(Code.VMRUNW).op_code_len == 2 assert OpCodeInfo(Code.SUB_R8_RM8).op_code_len == 1 assert OpCodeInfo(Code.CVTPI2PS_XMM_MMM64).op_code_len == 1
- Type:
- op_code_string¶
Gets the opcode string, eg.
VEX.128.66.0F38.W0 78 /r, see alsoOpCodeInfo.instruction_stringExamples:
from iced_x86 import * op_code = OpCodeInfo(Code.EVEX_VMOVAPD_YMM_K1Z_YMMM256) assert op_code.op_code_string == "EVEX.256.66.0F.W1 28 /r"
- Type:
- op_kind(operand)¶
Gets an operand’s opkind (an
OpCodeOperandKindenum value)- Parameters:
operand (int) – Operand number, 0-4
- Returns:
Operand kind
- Return type:
- Raises:
ValueError – If operand is invalid
- op_kinds()¶
Gets all operand kinds (a list of
OpCodeOperandKindenum values)- Returns:
All operand kinds
- Return type:
List[
OpCodeOperandKind]
- requires_unique_dest_reg_num¶
Trueif the destination register’s reg-num must not be present in any other operand, eg. MNEMONIC XMM1,YMM1,[RAX+ZMM1*2] is invalid. Registers = XMM/YMM/ZMM/TMM.- Type:
- requires_unique_reg_nums¶
Trueif the index reg’s reg-num (vsib op) (if any) and register ops’ reg-nums must be unique, eg.MNEMONIC XMM1,YMM1,[RAX+ZMM1*2]is invalid. Registers =XMM/YMM/ZMM/TMM.- Type:
- rm_group_index¶
(
i8) Group index (0-7) or -1. If it’s 0-7, it’s stored in thermfield of themodrmbyte.- Type:
- table¶
Gets the opcode table (an
OpCodeTableKindenum value)- Type:
- tdx_non_root_may_gen_ex¶
Trueif an exception (eg. #GP(0), #VE) may be generated in TDX non-root operation- Type:
- tsx_impl_abort¶
Trueif it causes a TSX abort inside a TSX transaction depending on the implementation- Type:
- tsx_may_abort¶
Trueif it may cause a TSX abort inside a TSX transaction depending on some condition- Type:
- w¶
(
u8) (VEX/XOP/EVEX/MVEX)Wvalue or default value ifOpCodeInfo.is_wigorOpCodeInfo.is_wig32isTrue- Type: