pub enum StandardOp {
Show 23 variants
CoreOp(CoreOp),
Set(Vec<f64>),
Alloc,
Free,
ToInt(usize),
ToFloat(usize),
Add(usize),
Sub(usize),
Mul(usize),
Div(usize),
Rem(usize),
Neg(usize),
IsNonNegative(usize),
Sin(usize),
Cos(usize),
Tan(usize),
ASin(usize),
ACos(usize),
ATan(usize),
Pow(usize),
Peek,
Poke,
Call(FFIBinding),
}
Expand description
An individual standard virtual machine instruction.
Variants§
CoreOp(CoreOp)
Execute a core instruction.
Set(Vec<f64>)
Set the register equal to a constant floating point value.
Alloc
Take the value of the register, and allocate that number of cells in memory. Set the register to the lowest address of the allocated memory.
Free
Free the memory pointed to by the register.
ToInt(usize)
Convert the register from a float to an integer.
ToFloat(usize)
Convert the register from an integer to a float.
Add(usize)
Add the value pointed to on the tape to the register (as floats).
Sub(usize)
Subtract the value pointed to on the tape from the register (as floats).
Mul(usize)
Multiply the register by the value pointed to on the tape (as floats).
Div(usize)
Divide the register by the value pointed to on the tape (as floats).
Rem(usize)
Store the remainder of the register and the value pointed to in the tape (as floats) into the register.
Neg(usize)
Negate the value of the register (as a float).
IsNonNegative(usize)
Make the register equal to the integer 1 if the register (as a float) is not negative, otherwise make it equal to 0.
Sin(usize)
Store the sine of the register (as a float) into the register. The argument is the size of the register vector.
Cos(usize)
Store the cosine of the register (as a float) into the register.
Tan(usize)
Store the tangent of the register (as a float) into the register.
ASin(usize)
Store the inverse-sine of the register (as a float) into the register.
ACos(usize)
Store the inverse-cosine of the register (as a float) into the register.
ATan(usize)
Store the inverse-tangent of the register (as a float) into the register.
Pow(usize)
Store the value of the register (as a float) to the power of the value pointed to on the tape (as a float) into the register.
Peek
Get a value from the input interface / device and store it in the register. This is intended to function something like system calls for using any external functionality that can’t be implemented in the virtual machine, such as I/O or OS operations.
Whenever a value is returned from the foreign function interface, it is stored in the FFI buffer of cells. Whenever an FFI function is called, it will receive its arguments from this buffer.
Poke
Write the value of the register to the output interface / device. This is intended to function something like system calls for using any external functionality that can’t be implemented in the virtual machine, such as I/O or OS operations.
Whenever a value is returned from the foreign function interface, it is stored in the FFI buffer of cells. Whenever an FFI function is called, it will receive its arguments from this buffer.
Call(FFIBinding)
Call a foreign function interface function.
Trait Implementations§
Source§impl Clone for StandardOp
impl Clone for StandardOp
Source§fn clone(&self) -> StandardOp
fn clone(&self) -> StandardOp
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for StandardOp
impl Debug for StandardOp
Source§impl<'de> Deserialize<'de> for StandardOp
impl<'de> Deserialize<'de> for StandardOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for StandardOp
impl Display for StandardOp
Source§impl PartialEq for StandardOp
impl PartialEq for StandardOp
Source§impl PartialOrd for StandardOp
impl PartialOrd for StandardOp
Source§impl Serialize for StandardOp
impl Serialize for StandardOp
impl StructuralPartialEq for StandardOp
Auto Trait Implementations§
impl Freeze for StandardOp
impl RefUnwindSafe for StandardOp
impl Send for StandardOp
impl Sync for StandardOp
impl Unpin for StandardOp
impl UnwindSafe for StandardOp
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more