Struct bad64::Instruction [−][src]
A decoded instruction
Implementations
impl Instruction
[src]
pub fn address(&self) -> u64
[src]
Returns the instruction address
Example
use bad64::decode; // nop - "\x1f\x20\x03\xd4" let decoded = decode(0xd503201f, 0x1000).unwrap(); assert_eq!(decoded.address(), 0x1000);
pub fn opcode(&self) -> u32
[src]
Returns the instruction opcode
Example
use bad64::decode; // nop - "\x1f\x20\x03\xd4" let decoded = decode(0xd503201f, 0x1000).unwrap(); assert_eq!(decoded.opcode(), 0xd503201f);
pub fn op(&self) -> Op
[src]
Returns the instruction operation
Example
use bad64::{decode, Op}; // nop - "\x1f\x20\x03\xd4" let decoded = decode(0xd503201f, 0x1000).unwrap(); assert_eq!(decoded.op(), Op::NOP);
pub fn operands(&self) -> &[Operand]
[src]
Returns a slice of Operands
Example
use bad64::{decode, Operand, Reg}; // eor x0, x1, x2 - "\x20\x00\x02\xca" let decoded = decode(0xca020020, 0x1000).unwrap(); let mut ops = decoded.operands(); assert_eq!(ops.len(), 3); assert_eq!(ops[0], Operand::Reg { reg: Reg::X0, arrspec: None }); assert_eq!(ops[1], Operand::Reg { reg: Reg::X1, arrspec: None }); assert_eq!(ops[2], Operand::Reg { reg: Reg::X2, arrspec: None });
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Instruction
[src]
impl Display for Instruction
[src]
impl Eq for Instruction
[src]
impl Hash for Instruction
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Instruction> for Instruction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,