Trait disassemble::Instruction [] [src]

pub trait Instruction: Debug + Display {
    fn address(&self) -> Address;
fn mnemonic(&self) -> &str;
fn comment(&self) -> Option<String>;
fn cycle_count(&self) -> Option<u32>;
fn is_call(&self) -> bool;
fn is_local_conditional_jump(&self) -> bool;
fn is_local_jump(&self) -> bool;
fn is_return(&self) -> bool;
fn target_address(&self) -> Option<Address>; fn is_block_terminator(&self) -> bool { ... } }

An assembly instruction, bytecode operation, VM operation, etc.

This trait will be implemented for a variety of backends and provides the general means by which the rest of the code in this library can be re-used.

This is intended to be fairly generic and is how other parts of this library query information that is specific to a given platform and body of generated code.

Required Methods

The address of this Instruction.

The address of an instruction must be unique within a function.

The mnemonic for this Instruction.

Any associated comment text for this instruction.

How many cycles does this instruction take to execute?

Does this instruction represent a call?

Does this instruction represent a local conditional jump?

Does this instruction represent a local conditional or unconditional jump?

Does this instruction represent a function return?

If this is a call or local jump, what is the target address?

Provided Methods

Does this instruction terminate a BasicBlock?

This is used when constructing a [control flow graph] to help break a sequence of instructions into basic blocks.

Implementors