pub struct Decoded { /* private fields */ }Expand description
A decoded instruction: the Inst, how many bytes it took, and the form
it matched.
§Examples
use isa_lang::x86_64::decode;
let d = decode(&[0x48, 0x8B, 0x44, 0x24, 0x08, 0xC3])?;
assert_eq!(d.len(), 5);
assert_eq!(d.inst().to_string(), "mov rax, qword ptr [rsp+0x8]");
assert_eq!(d.form().syntax(), "MOV r64, r/m64");Implementations§
Source§impl Decoded
impl Decoded
Sourcepub const fn inst(&self) -> Inst
pub const fn inst(&self) -> Inst
The instruction.
§Examples
use isa_lang::x86_64::{decode, Inst, Mnemonic};
assert_eq!(decode(&[0xCC])?.inst(), Inst::new(Mnemonic::Int3, []));Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
The number of bytes the instruction occupies (1 to 15).
§Examples
use isa_lang::x86_64::decode;
assert_eq!(decode(&[0x0F, 0x1F, 0x44, 0x00, 0x00])?.len(), 5);Sourcepub fn form(&self) -> &'static Form
pub fn form(&self) -> &'static Form
The table row the bytes matched.
§Examples
use isa_lang::x86_64::decode;
assert_eq!(decode(&[0x05, 1, 0, 0, 0])?.form().syntax(), "ADD EAX, imm32");Sourcepub const fn flags(&self) -> FlagEffects
pub const fn flags(&self) -> FlagEffects
What the instruction does to the flags, with a condition code’s reads filled in.
§Examples
use isa_lang::x86_64::{decode, Flags};
// sete al
assert_eq!(decode(&[0x0F, 0x94, 0xC0])?.flags().read(), Flags::ZF);Trait Implementations§
impl Copy for Decoded
impl Eq for Decoded
impl StructuralPartialEq for Decoded
Auto Trait Implementations§
impl Freeze for Decoded
impl RefUnwindSafe for Decoded
impl Send for Decoded
impl Sync for Decoded
impl Unpin for Decoded
impl UnsafeUnpin for Decoded
impl UnwindSafe for Decoded
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more