pub struct StackMachine {
pub st: StackMachineState,
pub trap_handlers: Vec<Box<dyn HandleTrap>>,
}
Fields§
§st: StackMachineState
§trap_handlers: Vec<Box<dyn HandleTrap>>
Implementations§
Source§impl StackMachine
impl StackMachine
Sourcepub fn execute(
&mut self,
starting_point: usize,
gas_limit: GasLimit,
) -> Result<(), StackMachineError>
pub fn execute( &mut self, starting_point: usize, gas_limit: GasLimit, ) -> Result<(), StackMachineError>
JR() is relative from the JR() instruction, 0 would jump back onto the JR instruction -1 Would jump back to the instruction before the JR(}) instruction 1 Would jump to the instruction after the JR() instruction
TRAPs always have a numeric code on the number stack to define which TRAP is being called
CMPLOOP pushes 1 on the stack if the loop counter is greater than or equal to the max pushes 0 on the stack if the loop counter is less than the max
Trait Implementations§
Source§impl Default for StackMachine
impl Default for StackMachine
Source§fn default() -> StackMachine
fn default() -> StackMachine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StackMachine
impl !RefUnwindSafe for StackMachine
impl !Send for StackMachine
impl !Sync for StackMachine
impl Unpin for StackMachine
impl !UnwindSafe for StackMachine
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