pub enum TinyInsn {
Halt,
LoadImm(TinyReg, u16),
Load(TinyReg, u16),
Store(TinyReg, u16),
Add(TinyReg, TinyReg),
Addi(TinyReg, i16),
Branch(usize),
BranchZero(TinyReg, usize),
}
Expand description
The instructions for the TinyVm
.
Variants§
Halt
Halt the VM.
LoadImm(TinyReg, u16)
Load the immediate value into the register reg = imm
.
Load(TinyReg, u16)
Load a value from the memory (absolute addressing) into the register reg = mem[imm]
.
Store(TinyReg, u16)
Store a value from the register into the memory (absolute addressing) mem[imm] = reg
.
Add(TinyReg, TinyReg)
Add the register to the register reg1 += reg2
.
Addi(TinyReg, i16)
Add the immediate to the register reg += imm
.
Branch(usize)
Jump unconditional (absolute addressing) pc = disp
.
BranchZero(TinyReg, usize)
Jump if the register is zero (absolute addressing) pc = (reg == 0) ? disp : pc++
.
Trait Implementations§
impl Copy for TinyInsn
impl StructuralPartialEq for TinyInsn
Auto Trait Implementations§
impl Freeze for TinyInsn
impl RefUnwindSafe for TinyInsn
impl Send for TinyInsn
impl Sync for TinyInsn
impl Unpin for TinyInsn
impl UnwindSafe for TinyInsn
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)