#[non_exhaustive]pub enum UsonicInstr {
Show 16 variants
CkNxIRo,
CkNxIAo,
CkNxORo,
CkNxOAo,
LdW,
LdIRo,
LdIAo,
LdORo,
LdOAo,
LdIW,
LdIL,
LdIT,
RstIRo,
RstIAo,
RstORo,
RstOAo,
}
Expand description
The instruction set uses iterator semantics and not random access semantic to correspond to the RISC type of the machine and not to add assumptions about abilities to access the operation state randomly. Operation state is always iterated, such that not a single state element can be missed (as long as the iterator runs to the end).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CkNxIRo
Checks whether there is a next destructible memory cell in the contract state listed in the
operation input and sets CO
register accordingly.
CkNxIAo
Checks whether there is a next immutable memory cell in the contract state listed in the
operation input and sets CO
register accordingly.
CkNxORo
Checks whether there is a next destructible memory cell defined by the operation and sets
CO
register accordingly.
CkNxOAo
Checks whether there is a next immutable memory cell defined by the operation and sets CO
register accordingly.
LdW
Load operation witness [StateValue
] to EA
-ED
registers.
LdIRo
Load next [StateValue
] from the current destructible memory cell input to EA
-ED
registers.
If the next state value is absent, sets CO
to a failed state. Otherwise, resets CO
.
LdIAo
Load next [StateValue
] from the current immutable memory cell input to EA
-ED
registers.
If the next state value is absent, sets CO
to a failed state. Otherwise, resets CO
.
LdORo
Load next [StateValue
] from the current destructible memory cell output to EA
-ED
registers.
If the next state value is absent, sets CO
to a failed state. Otherwise, resets CO
.
LdOAo
Load next [StateValue
] from the current immutable memory cell output to EA
-ED
registers.
If the next state value is absent, sets CO
to a failed state. Otherwise, resets CO
.
LdIW
Load destructible input witness [StateValue
] for the current input number (determined by
the value in UI
register) to EA
-ED
registers.
The operation is idempotent.
Does not update the value of UI
register.
If the input matching UI
index is absent, sets CO
to a failed state.
Otherwise, resets CO
.
LdIL
Load a lock conditions value for the current input number (determined by the value in UI
register) to EA
-ED
registers.
The operation is idempotent.
Does not update the value of UI
register.
If the input matching UI
index is absent, sets CO
to a failed state.
Otherwise, resets CO
.
LdIT
Load a destructible input authorization token [AuthToken
] for the current input number
(determined by the value in UI
register) to EA
register.
The operation also sets EB
to either 0
(if a custom lock script is not present)
or 1
, if it is present.
The operation is idempotent.
Does not update the value of UI
register.
If the input matching UI
index is absent, sets CO
to a failed state.
Otherwise, resets CO
.
RstIRo
Resets iterator over the input destructible memory cells by setting the corresponding UI
value to zero.
Does not affect the value of CO
or CK
registers.
RstIAo
Resets iterator over the input immutable memory cells by setting the corresponding UI
value to zero.
Does not affect the value of CO
or CK
registers.
RstORo
Resets iterator over the output destructible memory cells by setting the corresponding UI
value to zero.
Does not affect the value of CO
or CK
registers.
RstOAo
Resets iterator over the output immutable memory cells by setting the corresponding UI
value to zero.
Does not affect the value of CO
or CK
registers.
Trait Implementations§
Source§impl<Id> Bytecode<Id> for UsonicInstrwhere
Id: SiteId,
impl<Id> Bytecode<Id> for UsonicInstrwhere
Id: SiteId,
Source§fn op_range() -> RangeInclusive<u8>
fn op_range() -> RangeInclusive<u8>
Source§fn opcode_byte(&self) -> u8
fn opcode_byte(&self) -> u8
Source§fn code_byte_len(&self) -> u16
fn code_byte_len(&self) -> u16
Source§fn external_ref(&self) -> Option<Id>
fn external_ref(&self) -> Option<Id>
Source§fn encode_operands<W>(
&self,
_writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
fn encode_operands<W>(
&self,
_writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
Source§fn decode_operands<R>(
_reader: &mut R,
opcode: u8,
) -> Result<UsonicInstr, CodeEofError>
fn decode_operands<R>( _reader: &mut R, opcode: u8, ) -> Result<UsonicInstr, CodeEofError>
Source§fn encode_instr<W>(
&self,
writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
fn encode_instr<W>(
&self,
writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
Source§fn decode_instr<R>(reader: &mut R) -> Result<Self, CodeEofError>where
Self: Sized,
R: BytecodeRead<Id>,
fn decode_instr<R>(reader: &mut R) -> Result<Self, CodeEofError>where
Self: Sized,
R: BytecodeRead<Id>,
Source§impl Clone for UsonicInstr
impl Clone for UsonicInstr
Source§fn clone(&self) -> UsonicInstr
fn clone(&self) -> UsonicInstr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for UsonicInstr
impl Debug for UsonicInstr
Source§impl Display for UsonicInstr
impl Display for UsonicInstr
Source§impl<Id> From<UsonicInstr> for Instr<Id>where
Id: SiteId,
impl<Id> From<UsonicInstr> for Instr<Id>where
Id: SiteId,
Source§fn from(v: UsonicInstr) -> Instr<Id>
fn from(v: UsonicInstr) -> Instr<Id>
Source§impl Hash for UsonicInstr
impl Hash for UsonicInstr
Source§impl<Id> Instruction<Id> for UsonicInstrwhere
Id: SiteId,
impl<Id> Instruction<Id> for UsonicInstrwhere
Id: SiteId,
Source§const ISA_EXT: &'static [&'static str]
const ISA_EXT: &'static [&'static str]
Source§type Core = UsonicCore
type Core = UsonicCore
Source§fn is_goto_target(&self) -> bool
fn is_goto_target(&self) -> bool
Source§fn local_goto_pos(&mut self) -> GotoTarget<'_>
fn local_goto_pos(&mut self) -> GotoTarget<'_>
Source§fn remote_goto_pos(&mut self) -> Option<&mut Site<Id>>
fn remote_goto_pos(&mut self) -> Option<&mut Site<Id>>
Source§fn src_regs(&self) -> BTreeSet<RegE>
fn src_regs(&self) -> BTreeSet<RegE>
Source§fn dst_regs(&self) -> BTreeSet<RegE>
fn dst_regs(&self) -> BTreeSet<RegE>
Source§fn op_data_bytes(&self) -> u16
fn op_data_bytes(&self) -> u16
Source§fn ext_data_bytes(&self) -> u16
fn ext_data_bytes(&self) -> u16
Source§fn exec(
&self,
_site: Site<Id>,
core: &mut Core<Id, <UsonicInstr as Instruction<Id>>::Core>,
context: &<UsonicInstr as Instruction<Id>>::Context<'_>,
) -> ExecStep<Site<Id>>
fn exec( &self, _site: Site<Id>, core: &mut Core<Id, <UsonicInstr as Instruction<Id>>::Core>, context: &<UsonicInstr as Instruction<Id>>::Context<'_>, ) -> ExecStep<Site<Id>>
Source§fn isa_ext() -> Confined<BTreeSet<IsaId>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
fn isa_ext() -> Confined<BTreeSet<IsaId>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
Self::ISA_EXT
into a set of IsaId
.Source§fn regs(&self) -> BTreeSet<<Self::Core as CoreExt>::Reg>
fn regs(&self) -> BTreeSet<<Self::Core as CoreExt>::Reg>
Source§fn src_reg_bytes(&self) -> u16
fn src_reg_bytes(&self) -> u16
Source§fn dst_reg_bytes(&self) -> u16
fn dst_reg_bytes(&self) -> u16
Source§fn base_complexity(&self) -> u64
fn base_complexity(&self) -> u64
Source§fn complexity(&self) -> u64
fn complexity(&self) -> u64
Source§impl PartialEq for UsonicInstr
impl PartialEq for UsonicInstr
impl Copy for UsonicInstr
impl Eq for UsonicInstr
impl StructuralPartialEq for UsonicInstr
Auto Trait Implementations§
impl Freeze for UsonicInstr
impl RefUnwindSafe for UsonicInstr
impl Send for UsonicInstr
impl Sync for UsonicInstr
impl Unpin for UsonicInstr
impl UnwindSafe for UsonicInstr
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.