[][src]Trait olympia_core::instructions::EmbeddableParam

pub trait EmbeddableParam: Sized {
    fn extract(value: u8) -> Result<Self, ParseError>;
fn embed(&self) -> u8; fn extract_from_opcode(
        opcode: u8,
        pos: OpcodePosition
    ) -> Result<Self, ParseError> { ... }
fn embed_to_opcode(&self, opcode: u8, pos: OpcodePosition) -> u8 { ... } }

A value that can be embedded in an opcode

Required methods

fn extract(value: u8) -> Result<Self, ParseError>

Extracts the value from a given opcode. The value should be aligned to a byte for this method

fn embed(&self) -> u8

Returns a value to be embedded in an opcode.

Loading content...

Provided methods

fn extract_from_opcode(
    opcode: u8,
    pos: OpcodePosition
) -> Result<Self, ParseError>

Extracts a value from the given opcode.

fn embed_to_opcode(&self, opcode: u8, pos: OpcodePosition) -> u8

Embeds a value in the given opcode

Loading content...

Implementors

impl EmbeddableParam for ALOp[src]

impl EmbeddableParam for AccRegister[src]

impl EmbeddableParam for ByteRegisterTarget[src]

impl EmbeddableParam for Carry[src]

impl EmbeddableParam for Condition[src]

impl EmbeddableParam for Increment[src]

impl EmbeddableParam for RotateDirection[src]

impl EmbeddableParam for StackRegister[src]

impl EmbeddableParam for u8[src]

Loading content...