Trait cambridge_asm::inst::InstSet
source · pub trait InstSet: FromStr + 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§
fn as_func_ptr(&self) -> ExecFunc
fn from_func_ptr(_: ExecFunc) -> Result<Self, <Self as FromStr>::Err>
Object Safety§
This trait is not object safe.
Implementors§
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
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