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§
source§impl PartialEq for TinyInsn
impl PartialEq for TinyInsn
impl Copy for TinyInsn
impl StructuralPartialEq for TinyInsn
Auto Trait Implementations§
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