pub struct RegId(/* private fields */);
Expand description
Represents a 6-bit register ID, guaranteed to be masked by construction.
Implementations§
source§impl RegId
impl RegId
sourcepub const HP: Self = _
pub const HP: Self = _
Heap pointer. Memory address below the current bottom of the heap (points to free memory).
sourcepub const IS: Self = _
pub const IS: Self = _
Instructions start. Pointer to the start of the currently-executing code.
sourcepub const OF: Self = _
pub const OF: Self = _
Contains overflow/underflow of addition, subtraction, and multiplication.
sourcepub const SP: Self = _
pub const SP: Self = _
Stack pointer. Memory address on top of current writable stack area (points to free memory).
sourcepub const SSP: Self = _
pub const SSP: Self = _
Stack start pointer. Memory address of bottom of current writable stack area.
source§impl RegId
impl RegId
sourcepub fn new_checked(u: u8) -> Option<RegId>
pub fn new_checked(u: u8) -> Option<RegId>
Construct a register ID from the given value.
Returns None
if the value is outside the 6-bit value range.
source§impl RegId
impl RegId
sourcepub fn bal() -> Self
Available on crate feature typescript
only.
pub fn bal() -> Self
typescript
only.Received balance for this context.
sourcepub fn err() -> Self
Available on crate feature typescript
only.
pub fn err() -> Self
typescript
only.Error codes for particular operations.
sourcepub fn fp() -> Self
Available on crate feature typescript
only.
pub fn fp() -> Self
typescript
only.Frame pointer. Memory address of beginning of current call frame.
sourcepub fn hp() -> Self
Available on crate feature typescript
only.
pub fn hp() -> Self
typescript
only.Heap pointer. Memory address below the current bottom of the heap (points to free memory).
sourcepub fn is() -> Self
Available on crate feature typescript
only.
pub fn is() -> Self
typescript
only.Instructions start. Pointer to the start of the currently-executing code.
sourcepub fn of() -> Self
Available on crate feature typescript
only.
pub fn of() -> Self
typescript
only.Contains overflow/underflow of addition, subtraction, and multiplication.
sourcepub fn one() -> Self
Available on crate feature typescript
only.
pub fn one() -> Self
typescript
only.Contains one (1), for convenience.
sourcepub fn pc() -> Self
Available on crate feature typescript
only.
pub fn pc() -> Self
typescript
only.The program counter. Memory address of the current instruction.
sourcepub fn sp() -> Self
Available on crate feature typescript
only.
pub fn sp() -> Self
typescript
only.Stack pointer. Memory address on top of current writable stack area (points to free memory).
sourcepub fn spp() -> Self
Available on crate feature typescript
only.
pub fn spp() -> Self
typescript
only.Stack start pointer. Memory address of bottom of current writable stack area.
sourcepub fn writable() -> Self
Available on crate feature typescript
only.
pub fn writable() -> Self
typescript
only.Smallest writable register.
sourcepub fn zero() -> Self
Available on crate feature typescript
only.
pub fn zero() -> Self
typescript
only.Contains zero (0), for convenience.
sourcepub fn new_typescript(u: u8) -> Self
Available on crate feature typescript
only.
pub fn new_typescript(u: u8) -> Self
typescript
only.Construct a register ID from the given value.
The given value will be masked to 6 bits.
sourcepub fn to_u8_typescript(self) -> u8
Available on crate feature typescript
only.
pub fn to_u8_typescript(self) -> u8
typescript
only.A const alternative to the Into<u8>
implementation.
Trait Implementations§
source§impl FromWasmAbi for RegId
impl FromWasmAbi for RegId
source§impl IntoWasmAbi for RegId
impl IntoWasmAbi for RegId
source§impl LongRefFromWasmAbi for RegId
impl LongRefFromWasmAbi for RegId
source§impl OptionFromWasmAbi for RegId
impl OptionFromWasmAbi for RegId
source§impl OptionIntoWasmAbi for RegId
impl OptionIntoWasmAbi for RegId
source§impl Ord for RegId
impl Ord for RegId
source§impl PartialEq for RegId
impl PartialEq for RegId
source§impl PartialOrd for RegId
impl PartialOrd for RegId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl RefFromWasmAbi for RegId
impl RefFromWasmAbi for RegId
source§impl RefMutFromWasmAbi for RegId
impl RefMutFromWasmAbi for RegId
source§impl TryFromJsValue for RegId
impl TryFromJsValue for RegId
source§impl VectorFromWasmAbi for RegId
impl VectorFromWasmAbi for RegId
source§impl VectorIntoWasmAbi for RegId
impl VectorIntoWasmAbi for RegId
impl Copy for RegId
impl Eq for RegId
impl StructuralPartialEq for RegId
Auto Trait Implementations§
impl Freeze for RegId
impl RefUnwindSafe for RegId
impl Send for RegId
impl Sync for RegId
impl Unpin for RegId
impl UnwindSafe for RegId
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.