pub type Instruction = AnInstruction<BFieldElement>;
Expand description
An Instruction
has call
addresses encoded as absolute integers.
Aliased Type§
enum Instruction {
Show 46 variants
Pop(NumberOfWords),
Push(BFieldElement),
Divine(NumberOfWords),
Pick(OpStackElement),
Place(OpStackElement),
Dup(OpStackElement),
Swap(OpStackElement),
Halt,
Nop,
Skiz,
Call(BFieldElement),
Return,
Recurse,
RecurseOrReturn,
Assert,
ReadMem(NumberOfWords),
WriteMem(NumberOfWords),
Hash,
AssertVector,
SpongeInit,
SpongeAbsorb,
SpongeAbsorbMem,
SpongeSqueeze,
Add,
AddI(BFieldElement),
Mul,
Invert,
Eq,
Split,
Lt,
And,
Xor,
Log2Floor,
Pow,
DivMod,
PopCount,
XxAdd,
XxMul,
XInvert,
XbMul,
ReadIo(NumberOfWords),
WriteIo(NumberOfWords),
MerkleStep,
MerkleStepMem,
XxDotStep,
XbDotStep,
}
Variants§
Pop(NumberOfWords)
Push(BFieldElement)
Divine(NumberOfWords)
Pick(OpStackElement)
Place(OpStackElement)
Dup(OpStackElement)
Swap(OpStackElement)
Halt
Nop
Skiz
Call(BFieldElement)
Return
Recurse
RecurseOrReturn
Assert
ReadMem(NumberOfWords)
WriteMem(NumberOfWords)
Hash
AssertVector
SpongeInit
SpongeAbsorb
SpongeAbsorbMem
SpongeSqueeze
Add
AddI(BFieldElement)
Mul
Invert
Eq
Split
Lt
And
Xor
Log2Floor
Pow
DivMod
PopCount
XxAdd
XxMul
XInvert
XbMul
ReadIo(NumberOfWords)
WriteIo(NumberOfWords)
MerkleStep
MerkleStepMem
XxDotStep
XbDotStep
Implementations§
Source§impl Instruction
impl Instruction
Sourcepub fn arg(&self) -> Option<BFieldElement>
pub fn arg(&self) -> Option<BFieldElement>
Get the argument of the instruction, if it has one.
Sourcepub fn change_arg(
self,
new_arg: BFieldElement,
) -> Result<Self, InstructionError>
pub fn change_arg( self, new_arg: BFieldElement, ) -> Result<Self, InstructionError>
Change the argument of the instruction, if it has one. Returns an Err
if the instruction
does not have an argument or if the argument is out of range.
Trait Implementations§
Source§impl TryFrom<BFieldElement> for Instruction
impl TryFrom<BFieldElement> for Instruction
Source§type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.
Source§fn try_from(opcode: BFieldElement) -> Result<Self, InstructionError>
fn try_from(opcode: BFieldElement) -> Result<Self, InstructionError>
Performs the conversion.
Source§impl TryFrom<u32> for Instruction
impl TryFrom<u32> for Instruction
Source§type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.
Source§impl TryFrom<u64> for Instruction
impl TryFrom<u64> for Instruction
Source§type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.
Source§impl TryFrom<usize> for Instruction
impl TryFrom<usize> for Instruction
Source§type Error = InstructionError
type Error = InstructionError
The type returned in the event of a conversion error.