Module bddisasm::cpuid

source ·
Expand description

CPUID information used to check if an instruction is supported on a CPU or not.

§Examples

use bddisasm::{DecodedInstruction, DecodeMode};

// `ENCLS`
let ins = DecodedInstruction::decode(&[0x0f, 0x01, 0xcf], DecodeMode::Bits64).ok()?;
let cpuid = ins.cpuid()?;
println!("Leaf: {}", cpuid.leaf);
match cpuid.sub_leaf {
    Some(sub_leaf) => println!("Sub-leaf: {}", sub_leaf),
    None => println!("Sub-leaf: None"),
}
println!("Register to check: {} Bit: {}", cpuid.register, cpuid.bit);

Structs§

  • Describes the CPUID leaf, sub-leaf, register & bit that indicate whether an instruction is supported or not.