pub trait InstSet: FromStr + Display
where <Self as FromStr>::Err: Display,
{ // Required methods fn as_func_ptr(&self) -> ExecFunc; fn from_func_ptr(_: ExecFunc) -> Result<Self, <Self as FromStr>::Err>; }
Expand description

Trait for instruction sets

Implement this for custom instruction sets. Manual implementation is tedious, so use [inst_set] or [extend] macros if possible

Required Methods§

source

fn as_func_ptr(&self) -> ExecFunc

source

fn from_func_ptr(_: ExecFunc) -> Result<Self, <Self as FromStr>::Err>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl InstSet for Core

The core instruction set

  • Memory and register manipulation: LDM, LDD, LDI, LDX, LDR, MOV, STO

  • Comparison: CMP, JPE, JPN, JMP, CMI

  • Basic I/O: IN, OUT, END

  • Arithmetic: INC, DEC, ADD, SUB

  • Bit manipulation: AND, OR, XOR, LSL, LSR

source§

impl InstSet for Extended

Available on crate feature extended only.

The extended instruction set

Core, plus debugging (DBG), raw input (RIN), function CALL and return (RET), and no-op (NOP) instructions