[][src]Struct iced_x86::OpCodeInfo

pub struct OpCodeInfo { /* fields omitted */ }

Opcode info, returned by Code::op_code() and Instruction::op_code()

Implementations

impl OpCodeInfo[src]

#[must_use]pub fn code(&self) -> Code[src]

Gets the code

Examples

use iced_x86::*;

let op_code = Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code();
assert_eq!(Code::EVEX_Vmovapd_ymm_k1z_ymmm256, op_code.code());

#[must_use]pub fn mnemonic(&self) -> Mnemonic[src]

Gets the mnemonic

Examples

use iced_x86::*;

let op_code = Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code();
assert_eq!(Mnemonic::Vmovapd, op_code.mnemonic());

#[must_use]pub fn encoding(&self) -> EncodingKind[src]

Gets the encoding

Examples

use iced_x86::*;

let op_code = Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code();
assert_eq!(EncodingKind::EVEX, op_code.encoding());

#[must_use]pub fn is_instruction(&self) -> bool[src]

true if it's an instruction, false if it's eg. Code::INVALID, db, dw, dd, dq

Examples

use iced_x86::*;

assert!(Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code().is_instruction());
assert!(!Code::INVALID.op_code().is_instruction());
assert!(!Code::DeclareByte.op_code().is_instruction());

#[must_use]pub fn mode16(&self) -> bool[src]

true if it's an instruction available in 16-bit mode

#[must_use]pub fn mode32(&self) -> bool[src]

true if it's an instruction available in 32-bit mode

#[must_use]pub fn mode64(&self) -> bool[src]

true if it's an instruction available in 64-bit mode

#[must_use]pub fn fwait(&self) -> bool[src]

true if an FWAIT (9B) instruction is added before the instruction

#[must_use]pub fn operand_size(&self) -> u32[src]

(Legacy encoding) Gets the required operand size (16,32,64) or 0

#[must_use]pub fn address_size(&self) -> u32[src]

(Legacy encoding) Gets the required address size (16,32,64) or 0

#[must_use]pub fn l(&self) -> u32[src]

(VEX/XOP/EVEX) L / L'L value or default value if is_lig() is true

#[must_use]pub fn w(&self) -> u32[src]

(VEX/XOP/EVEX) W value or default value if is_wig() or is_wig32() is true

#[must_use]pub fn is_lig(&self) -> bool[src]

(VEX/XOP/EVEX) true if the L / L'L fields are ignored.

EVEX: if reg-only ops and {er} (EVEX.b is set), L'L is the rounding control and not ignored.

#[must_use]pub fn is_wig(&self) -> bool[src]

(VEX/XOP/EVEX) true if the W field is ignored in 16/32/64-bit modes

#[must_use]pub fn is_wig32(&self) -> bool[src]

(VEX/XOP/EVEX) true if the W field is ignored in 16/32-bit modes (but not 64-bit mode)

#[must_use]pub fn tuple_type(&self) -> TupleType[src]

(EVEX) Gets the tuple type

#[must_use]pub fn memory_size(&self) -> MemorySize[src]

If it has a memory operand, gets the MemorySize (non-broadcast memory type)

#[must_use]pub fn broadcast_memory_size(&self) -> MemorySize[src]

If it has a memory operand, gets the MemorySize (broadcast memory type)

#[must_use]pub fn can_broadcast(&self) -> bool[src]

(EVEX) true if the instruction supports broadcasting (EVEX.b bit) (if it has a memory operand)

#[must_use]pub fn can_use_rounding_control(&self) -> bool[src]

(EVEX) true if the instruction supports rounding control

#[must_use]pub fn can_suppress_all_exceptions(&self) -> bool[src]

(EVEX) true if the instruction supports suppress all exceptions

#[must_use]pub fn can_use_op_mask_register(&self) -> bool[src]

(EVEX) true if an op mask register can be used

#[must_use]pub fn require_op_mask_register(&self) -> bool[src]

(EVEX) true if a non-zero op mask register must be used

#[must_use]pub fn require_non_zero_op_mask_register(&self) -> bool[src]

👎 Deprecated since 1.9.0:

Use require_op_mask_register() instead

(EVEX) true if a non-zero op mask register must be used

#[must_use]pub fn can_use_zeroing_masking(&self) -> bool[src]

(EVEX) true if the instruction supports zeroing masking (if one of the op mask registers K1-K7 is used and destination operand is not a memory operand)

#[must_use]pub fn can_use_lock_prefix(&self) -> bool[src]

true if the LOCK (F0) prefix can be used

#[must_use]pub fn can_use_xacquire_prefix(&self) -> bool[src]

true if the XACQUIRE (F2) prefix can be used

#[must_use]pub fn can_use_xrelease_prefix(&self) -> bool[src]

true if the XRELEASE (F3) prefix can be used

#[must_use]pub fn can_use_rep_prefix(&self) -> bool[src]

true if the REP / REPE (F3) prefixes can be used

#[must_use]pub fn can_use_repne_prefix(&self) -> bool[src]

true if the REPNE (F2) prefix can be used

#[must_use]pub fn can_use_bnd_prefix(&self) -> bool[src]

true if the BND (F2) prefix can be used

#[must_use]pub fn can_use_hint_taken_prefix(&self) -> bool[src]

true if the HINT-TAKEN (3E) and HINT-NOT-TAKEN (2E) prefixes can be used

#[must_use]pub fn can_use_notrack_prefix(&self) -> bool[src]

true if the NOTRACK (3E) prefix can be used

#[must_use]pub fn ignores_rounding_control(&self) -> bool[src]

true if rounding control is ignored (#UD is not generated)

#[must_use]pub fn amd_lock_reg_bit(&self) -> bool[src]

true if the LOCK prefix can be used as an extra register bit (bit 3) to access registers 8-15 without a REX prefix (eg. in 32-bit mode)

#[must_use]pub fn default_op_size64(&self) -> bool[src]

true if the default operand size is 64 in 64-bit mode. A 66 prefix can switch to 16-bit operand size.

#[must_use]pub fn force_op_size64(&self) -> bool[src]

true if the operand size is always 64 in 64-bit mode. A 66 prefix is ignored.

#[must_use]pub fn intel_force_op_size64(&self) -> bool[src]

true if the Intel decoder forces 64-bit operand size. A 66 prefix is ignored.

#[must_use]pub fn must_be_cpl0(&self) -> bool[src]

true if it can only be executed when CPL=0

#[must_use]pub fn cpl0(&self) -> bool[src]

true if it can be executed when CPL=0

#[must_use]pub fn cpl1(&self) -> bool[src]

true if it can be executed when CPL=1

#[must_use]pub fn cpl2(&self) -> bool[src]

true if it can be executed when CPL=2

#[must_use]pub fn cpl3(&self) -> bool[src]

true if it can be executed when CPL=3

#[must_use]pub fn is_input_output(&self) -> bool[src]

true if the instruction accesses the I/O address space (eg. IN, OUT, INS, OUTS)

#[must_use]pub fn is_nop(&self) -> bool[src]

true if it's one of the many nop instructions (does not include FPU nop instructions, eg. FNOP)

#[must_use]pub fn is_reserved_nop(&self) -> bool[src]

true if it's one of the many reserved nop instructions (eg. 0F0D, 0F18-0F1F)

#[must_use]pub fn is_serializing_intel(&self) -> bool[src]

true if it's a serializing instruction (Intel CPUs)

#[must_use]pub fn is_serializing_amd(&self) -> bool[src]

true if it's a serializing instruction (AMD CPUs)

#[must_use]pub fn may_require_cpl0(&self) -> bool[src]

true if the instruction requires either CPL=0 or CPL<=3 depending on some CPU option (eg. CR4.TSD, CR4.PCE, CR4.UMIP)

#[must_use]pub fn is_cet_tracked(&self) -> bool[src]

true if it's a tracked JMP/CALL indirect instruction (CET)

#[must_use]pub fn is_non_temporal(&self) -> bool[src]

true if it's a non-temporal hint memory access (eg. MOVNTDQ)

#[must_use]pub fn is_fpu_no_wait(&self) -> bool[src]

true if it's a no-wait FPU instruction, eg. FNINIT

#[must_use]pub fn ignores_mod_bits(&self) -> bool[src]

true if the mod bits are ignored and it's assumed modrm[7:6] == 11b

#[must_use]pub fn no66(&self) -> bool[src]

true if the 66 prefix is not allowed (it will #UD)

#[must_use]pub fn nfx(&self) -> bool[src]

true if the F2/F3 prefixes aren't allowed

#[must_use]pub fn requires_unique_reg_nums(&self) -> bool[src]

true if 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.

#[must_use]pub fn is_privileged(&self) -> bool[src]

true if it's a privileged instruction (all CPL=0 instructions (except VMCALL) and IOPL instructions IN, INS, OUT, OUTS, CLI, STI)

#[must_use]pub fn is_save_restore(&self) -> bool[src]

true if it reads/writes too many registers

#[must_use]pub fn is_stack_instruction(&self) -> bool[src]

true if it's an instruction that implicitly uses the stack register, eg. CALL, POP, etc

#[must_use]pub fn ignores_segment(&self) -> bool[src]

true if the instruction doesn't read the segment register if it uses a memory operand

#[must_use]pub fn is_op_mask_read_write(&self) -> bool[src]

true if the op mask register is read and written (instead of just read). This also implies that it can't be K0.

#[must_use]pub fn real_mode(&self) -> bool[src]

true if it can be executed in real mode

#[must_use]pub fn protected_mode(&self) -> bool[src]

true if it can be executed in protected mode

#[must_use]pub fn virtual8086_mode(&self) -> bool[src]

true if it can be executed in virtual 8086 mode

#[must_use]pub fn compatibility_mode(&self) -> bool[src]

true if it can be executed in compatibility mode

#[must_use]pub fn long_mode(&self) -> bool[src]

true if it can be executed in 64-bit mode

#[must_use]pub fn use_outside_smm(&self) -> bool[src]

true if it can be used outside SMM

#[must_use]pub fn use_in_smm(&self) -> bool[src]

true if it can be used in SMM

#[must_use]pub fn use_outside_enclave_sgx(&self) -> bool[src]

true if it can be used outside an enclave (SGX)

#[must_use]pub fn use_in_enclave_sgx1(&self) -> bool[src]

true if it can be used inside an enclave (SGX1)

#[must_use]pub fn use_in_enclave_sgx2(&self) -> bool[src]

true if it can be used inside an enclave (SGX2)

#[must_use]pub fn use_outside_vmx_op(&self) -> bool[src]

true if it can be used outside VMX operation

#[must_use]pub fn use_in_vmx_root_op(&self) -> bool[src]

true if it can be used in VMX root operation

#[must_use]pub fn use_in_vmx_non_root_op(&self) -> bool[src]

true if it can be used in VMX non-root operation

#[must_use]pub fn use_outside_seam(&self) -> bool[src]

true if it can be used outside SEAM

#[must_use]pub fn use_in_seam(&self) -> bool[src]

true if it can be used in SEAM

#[must_use]pub fn tdx_non_root_gen_ud(&self) -> bool[src]

true if #UD is generated in TDX non-root operation

#[must_use]pub fn tdx_non_root_gen_ve(&self) -> bool[src]

true if #VE is generated in TDX non-root operation

#[must_use]pub fn tdx_non_root_may_gen_ex(&self) -> bool[src]

true if an exception (eg. #GP(0), #VE) may be generated in TDX non-root operation

#[must_use]pub fn intel_vm_exit(&self) -> bool[src]

(Intel VMX) true if it causes a VM exit in VMX non-root operation

#[must_use]pub fn intel_may_vm_exit(&self) -> bool[src]

(Intel VMX) true if it may cause a VM exit in VMX non-root operation

#[must_use]pub fn intel_smm_vm_exit(&self) -> bool[src]

(Intel VMX) true if it causes an SMM VM exit in VMX root operation (if dual-monitor treatment is activated)

#[must_use]pub fn amd_vm_exit(&self) -> bool[src]

(AMD SVM) true if it causes a #VMEXIT in guest mode

#[must_use]pub fn amd_may_vm_exit(&self) -> bool[src]

(AMD SVM) true if it may cause a #VMEXIT in guest mode

#[must_use]pub fn tsx_abort(&self) -> bool[src]

true if it causes a TSX abort inside a TSX transaction

#[must_use]pub fn tsx_impl_abort(&self) -> bool[src]

true if it causes a TSX abort inside a TSX transaction depending on the implementation

#[must_use]pub fn tsx_may_abort(&self) -> bool[src]

true if it may cause a TSX abort inside a TSX transaction depending on some condition

#[must_use]pub fn intel_decoder16(&self) -> bool[src]

true if it's decoded by iced's 16-bit Intel decoder

#[must_use]pub fn intel_decoder32(&self) -> bool[src]

true if it's decoded by iced's 32-bit Intel decoder

#[must_use]pub fn intel_decoder64(&self) -> bool[src]

true if it's decoded by iced's 64-bit Intel decoder

#[must_use]pub fn amd_decoder16(&self) -> bool[src]

true if it's decoded by iced's 16-bit AMD decoder

#[must_use]pub fn amd_decoder32(&self) -> bool[src]

true if it's decoded by iced's 32-bit AMD decoder

#[must_use]pub fn amd_decoder64(&self) -> bool[src]

true if it's decoded by iced's 64-bit AMD decoder

#[must_use]pub fn decoder_option(&self) -> u32[src]

Gets the decoder option that's needed to decode the instruction or DecoderOptions::NONE. The return value is a DecoderOptions value.

#[must_use]pub fn table(&self) -> OpCodeTableKind[src]

Gets the opcode table

#[must_use]pub fn mandatory_prefix(&self) -> MandatoryPrefix[src]

Gets the mandatory prefix

#[must_use]pub fn op_code(&self) -> u32[src]

Gets the opcode byte(s). The low byte(s) of this value is the opcode. The length is in op_code_len(). It doesn't include the table value, see table().

Examples

use iced_x86::*;

assert_eq!(0xDFC0, Code::Ffreep_sti.op_code().op_code());
assert_eq!(0x01D8, Code::Vmrunw.op_code().op_code());
assert_eq!(0x2A, Code::Sub_r8_rm8.op_code().op_code());
assert_eq!(0x2A, Code::Cvtpi2ps_xmm_mmm64.op_code().op_code());

#[must_use]pub fn op_code_len(&self) -> u32[src]

Gets the length of the opcode bytes (op_code()). The low bytes is the opcode value.

Examples

use iced_x86::*;

assert_eq!(2, Code::Ffreep_sti.op_code().op_code_len());
assert_eq!(2, Code::Vmrunw.op_code().op_code_len());
assert_eq!(1, Code::Sub_r8_rm8.op_code().op_code_len());
assert_eq!(1, Code::Cvtpi2ps_xmm_mmm64.op_code().op_code_len());

#[must_use]pub fn is_group(&self) -> bool[src]

true if it's part of a group

#[must_use]pub fn group_index(&self) -> i32[src]

Group index (0-7) or -1. If it's 0-7, it's stored in the reg field of the modrm byte.

#[must_use]pub fn is_rm_group(&self) -> bool[src]

true if it's part of a modrm.rm group

#[must_use]pub fn rm_group_index(&self) -> i32[src]

Group index (0-7) or -1. If it's 0-7, it's stored in the rm field of the modrm byte.

#[must_use]pub fn op_count(&self) -> u32[src]

Gets the number of operands

#[must_use]pub fn op0_kind(&self) -> OpCodeOperandKind[src]

Gets operand #0's opkind

#[must_use]pub fn op1_kind(&self) -> OpCodeOperandKind[src]

Gets operand #1's opkind

#[must_use]pub fn op2_kind(&self) -> OpCodeOperandKind[src]

Gets operand #2's opkind

#[must_use]pub fn op3_kind(&self) -> OpCodeOperandKind[src]

Gets operand #3's opkind

#[must_use]pub fn op4_kind(&self) -> OpCodeOperandKind[src]

Gets operand #4's opkind

#[must_use]pub fn op_kind(&self, operand: u32) -> OpCodeOperandKind[src]

Gets an operand's opkind

Panics

Panics if operand is invalid

Arguments

  • operand: Operand number, 0-4

#[must_use]pub fn op_kinds(&self) -> &[OpCodeOperandKind][src]

Gets all operand kinds

#[must_use]pub fn is_available_in_mode(&self, bitness: u32) -> bool[src]

Checks if the instruction is available in 16-bit mode, 32-bit mode or 64-bit mode

Arguments

  • bitness: 16, 32 or 64

#[must_use]pub fn op_code_string(&self) -> &str[src]

Gets the opcode string, eg. VEX.128.66.0F38.W0 78 /r, see also instruction_string()

Examples

use iced_x86::*;

let op_code = Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code();
assert_eq!("EVEX.256.66.0F.W1 28 /r", op_code.op_code_string());

#[must_use]pub fn instruction_string(&self) -> &str[src]

Gets the instruction string, eg. VPBROADCASTB xmm1, xmm2/m8, see also op_code_string()

Examples

use iced_x86::*;

let op_code = Code::EVEX_Vmovapd_ymm_k1z_ymmm256.op_code();
assert_eq!("VMOVAPD ymm1 {k1}{z}, ymm2/m256", op_code.instruction_string());

Trait Implementations

impl Clone for OpCodeInfo[src]

impl Debug for OpCodeInfo[src]

impl Display for OpCodeInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.