triton_isa::instruction

Type Alias Instruction

Source
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

Source

pub fn arg(&self) -> Option<BFieldElement>

Get the argument of the instruction, if it has one.

Source

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

Source§

type Error = InstructionError

The type returned in the event of a conversion error.
Source§

fn try_from(opcode: BFieldElement) -> Result<Self, InstructionError>

Performs the conversion.
Source§

impl TryFrom<u32> for Instruction

Source§

type Error = InstructionError

The type returned in the event of a conversion error.
Source§

fn try_from(opcode: u32) -> Result<Self, InstructionError>

Performs the conversion.
Source§

impl TryFrom<u64> for Instruction

Source§

type Error = InstructionError

The type returned in the event of a conversion error.
Source§

fn try_from(opcode: u64) -> Result<Self, InstructionError>

Performs the conversion.
Source§

impl TryFrom<usize> for Instruction

Source§

type Error = InstructionError

The type returned in the event of a conversion error.
Source§

fn try_from(opcode: usize) -> Result<Self, InstructionError>

Performs the conversion.