REXX Language implementation
These instructions manage attribute-backed arrays and objects, live register and attribute bindings, first-class storage references, and runtime object type/initialization metadata.
Attribute counts and bulk edits distinguish zero-based forms from the *1
one-based forms. link* instructions rebind storage pointers rather than
copying payloads; unlink* restores retained base storage without copy-back.
Reference values track storage lifetime and raise REFERENCE_INVALID when a
raising operation encounters a dead target.
assertinitializedRequire that a register is not marked as an uninitialized typed object.
| Opcode | Form | Effect |
|---|---|---|
0x0055 |
assertinitialized rObject |
Continue only when rObject is initialized. |
The register is inspected but not modified. Ordinary scalar and untyped values
are considered initialized; the check specifically recognizes the marker set
by setobjuninit.
Raises OBJECT_NOT_INITIALIZED for a marked value, including its runtime type
name in the message when that message can be allocated.
.globals=0
main() .locals=1
load r0,1
assertinitialized r0
ret
isinitialized, setobjuninit, setobjtype.
delattrsDelete a strict zero-based range of logical attributes.
| Opcode | Form | Effect |
|---|---|---|
0x022b |
delattrs rObject,rIndex,rCount |
Register index and count. |
0x022c |
delattrs rObject,rIndex,count |
Register index, literal count. |
0x022d |
delattrs rObject,index,rCount |
Literal index, register count. |
0x022e |
delattrs rObject,index,count |
Literal index and count. |
The range is removed and later attributes shift left. Removed child storage is
reset and references to it become invalid. A zero count is a no-op, but its
index must still be in 0..logical_count. Existing links move with surviving
attribute slots; private capacity may shrink after a large deletion.
Raises OUT_OF_RANGE for negative register operands, an index outside the
allowed range, or a range extending past the logical count.
.globals=0
main() .locals=1
setattrs r0,3
delattrs r0,1,1
ret
delattrs1, insattrs, setattrs.
delattrs1Delete a strict one-based range of logical attributes.
| Opcode | Form | Effect |
|---|---|---|
0x022f |
delattrs1 rObject,rIndex,rCount |
Register index and count. |
0x0230 |
delattrs1 rObject,rIndex,count |
Register index, literal count. |
0x0231 |
delattrs1 rObject,index,rCount |
Literal index, register count. |
0x0232 |
delattrs1 rObject,index,count |
Literal index and count. |
This is delattrs with the source index translated by subtracting one. Later
attributes shift left and removed storage is reset. For a zero count, valid
one-based insertion-style positions are 1..logical_count+1.
Raises OUT_OF_RANGE for an index less than one, negative count, or a range
past the logical attributes.
.globals=0
main() .locals=1
setattrs r0,3
delattrs1 r0,2,1
ret
delattrs, insattrs1, setattrs.
derefCopy the current value of referenced storage into a destination register.
| Opcode | Form | Effect |
|---|---|---|
0x00c3 |
deref rDst,rReference |
Snapshot the referenced value into rDst. |
rReference must hold a reference payload created by mkref. rDst receives
a full value copy, including nested attributes; it is not linked to later
updates. The reference and target are unchanged.
Raises REFERENCE_INVALID if the register has no live reference target.
.globals=0
main() .locals=3
load r1,"value"
mkref r0,r1
deref r2,r0
ret
mkref, linkref, setref.
getabufsRead an object’s current private attribute-storage capacity.
| Opcode | Form | Effect |
|---|---|---|
0x00dc |
getabufs rCapacity,rObject |
Store rObject.max_num_attributes. |
rCapacity receives an integer count of allocated attribute slots, which may
exceed the logical count returned by getattrs. The source and all attribute
values are unchanged. Capacity is an implementation detail for diagnostics and
tuning, not a logical array bound.
This instruction does not raise a signal.
.globals=0
main() .locals=2
setattrs r1,2
getabufs r0,r1
ret
getattrs, setattrs, minattrs.
getattrsReturn an object’s logical attribute count, optionally with an integer bias.
| Opcode | Form | Effect |
|---|---|---|
0x00d6 |
getattrs rCount,rObject |
Store the logical attribute count. |
0x00d7 |
getattrs rCount,rObject,adjustment |
Store the count plus an integer literal. |
Only rCount’s integer payload is written. The object, attribute values,
links, and capacity are unchanged. The adjustment form is useful when adapting
between zero- and one-based source conventions.
This instruction performs no bounds check and raises no signal; integer addition follows the VM integer representation.
.globals=0
main() .locals=2
setattrs r1,3
getattrs r0,r1
ret
getabufs, setattrs, minattrs.
insattrsInsert cleared attributes before a zero-based logical position.
| Opcode | Form | Effect |
|---|---|---|
0x0223 |
insattrs rObject,rIndex,rCount |
Register index and count. |
0x0224 |
insattrs rObject,rIndex,count |
Register index, literal count. |
0x0225 |
insattrs rObject,index,rCount |
Literal index, register count. |
0x0226 |
insattrs rObject,index,count |
Literal index and count. |
Valid indexes are 0..logical_count; the end position appends. Existing
attribute storage pointers, values, links, and reference identities move right
with their logical elements. Inserted slots use cleared base storage. A zero
count changes nothing but still requires a valid index.
Raises OUT_OF_RANGE for negative register operands, an index beyond the end,
or count/size arithmetic overflow.
.globals=0
main() .locals=1
setattrs r0,2
insattrs r0,1,1
ret
insattrs1, delattrs, setattrs.
insattrs1Insert cleared attributes before a one-based logical position.
| Opcode | Form | Effect |
|---|---|---|
0x0227 |
insattrs1 rObject,rIndex,rCount |
Register index and count. |
0x0228 |
insattrs1 rObject,rIndex,count |
Register index, literal count. |
0x0229 |
insattrs1 rObject,index,rCount |
Literal index, register count. |
0x022a |
insattrs1 rObject,index,count |
Literal index and count. |
Valid positions are 1..logical_count+1; the last position appends. The VM
subtracts one and otherwise applies insattrs semantics, preserving the
identity and bindings of shifted attributes. A zero count is a no-op after
position validation.
Raises OUT_OF_RANGE for an index less than one, a negative count, a position
past the append point, or size arithmetic overflow.
.globals=0
main() .locals=1
setattrs r0,2
insattrs1 r0,2,1
ret
insattrs, delattrs1, setattrs.
isinitializedTest whether a register is free of the uninitialized-object marker.
| Opcode | Form | Effect |
|---|---|---|
0x0056 |
isinitialized rResult,rValue |
Store integer 1 when initialized, otherwise 0. |
The destination is first cleared and then receives an integer Boolean. The
source is unchanged. Scalars and untyped values return 1.
This non-raising probe does not signal for an uninitialized value.
.globals=0
main() .locals=2
load r1,1
isinitialized r0,r1
ret
assertinitialized, setobjuninit.
linkRebind one local register number to another register’s current storage.
| Opcode | Form | Effect |
|---|---|---|
0x00d4 |
link rLocal,rTarget |
Make rLocal a live alias of rTarget. |
The current frame’s register-pointer entry for rLocal is replaced. All later
payload, attribute, flag, and reference operations through rLocal
affect the target storage. Links may be chained. unlink rLocal restores that
register number’s original base storage, not a copy of the target value.
This instruction performs no copy or allocation and does not signal.
.globals=0
main() .locals=2
load r0,"base"
load r1,"target"
link r0,r1
load r0,"changed"
unlink r0
ret
unlink, linkref, linkattr.
linkargRebind a local register to argument storage in the current frame.
| Opcode | Form | Effect |
|---|---|---|
0x01ff |
linkarg rLocal,index |
Link to argument slot index. |
0x0200 |
linkarg rLocal,rBase,adjustment |
Link to slot rBase + adjustment. |
Argument storage follows the frame’s global and local register regions; the VM
adds those region sizes internally. rLocal becomes a live alias and can later
be restored with unlink. The first form uses an integer literal; the dynamic
form uses an integer register plus a literal.
The VM performs no runtime argument-bound check in this opcode. The compiler or
hand-written caller must ensure the computed slot exists; an invalid slot is
undefined behavior rather than OUT_OF_RANGE.
This complete example is assembly-tested only because executing worker
requires a caller-created argument frame.
.globals=0
main() .locals=0
ret
worker() .locals=1
linkarg r0,0
unlink r0
ret
link, unlink, linkref.
linkattrRebind a local register to a zero-based attribute storage slot.
| Opcode | Form | Effect |
|---|---|---|
0x00c8 |
linkattr rLocal,rObject,rIndex |
Use an integer register index. |
0x00c9 |
linkattr rLocal,rObject,index |
Use an integer literal index. |
rLocal becomes a live alias of the attribute’s currently bound storage.
Writes through it update that attribute. unlink rLocal restores the local’s
base storage. The object and index are otherwise unchanged.
Raises OUT_OF_RANGE for a negative index or an index at or beyond the logical
attribute count.
.globals=0
main() .locals=2
setattrs r1,1
linkattr r0,r1,0
load r0,"value"
unlink r0
ret
linkattr1, linktoattr, unlink.
linkattr1Rebind a local register to a one-based attribute storage slot.
| Opcode | Form | Effect |
|---|---|---|
0x00ca |
linkattr1 rLocal,rObject,rIndex |
Use an integer register index. |
0x00cb |
linkattr1 rLocal,rObject,index |
Use an integer literal index. |
The VM subtracts one from the index and otherwise applies linkattr semantics.
The local remains a live alias until unlink; updates are not copied back as a
separate step.
Raises OUT_OF_RANGE for an index less than one or greater than the logical
attribute count.
.globals=0
main() .locals=2
setattrs r1,1
linkattr1 r0,r1,1
load r0,"value"
unlink r0
ret
linkattr, linktoattr1, unlink.
linkrefRebind a local register to the storage named by a reference value.
| Opcode | Form | Effect |
|---|---|---|
0x00c4 |
linkref rLocal,rReference |
Make rLocal a live alias of the reference target. |
The current frame’s register binding is replaced with the target storage
pointer. Subsequent reads and writes through rLocal affect that storage until
unlink rLocal restores its original base storage. rReference is unchanged.
Raises REFERENCE_INVALID when the reference has no live target.
.globals=0
main() .locals=3
load r1,"before"
mkref r0,r1
linkref r2,r0
load r2,"after"
unlink r2
ret
mkref, unlink, setref.
linktoattrBind a zero-based attribute slot to external register storage.
| Opcode | Form | Effect |
|---|---|---|
0x00cc |
linktoattr rIndex,rObject,rTarget |
Use an integer register index. |
0x00cd |
linktoattr index,rObject,rTarget |
Use an integer literal index. |
The attribute pointer is replaced by rTarget’s currently bound storage.
Reads or writes through the attribute therefore affect rTarget. The
attribute’s original base storage remains retained by the object and can be
restored with unlinkattr.
Raises OUT_OF_RANGE for a negative index or an index at or beyond the logical
attribute count.
.globals=0
main() .locals=2
setattrs r0,1
load r1,"external"
linktoattr 0,r0,r1
unlinkattr 0,r0
ret
linkattr, unlinkattr, linktoattr1.
linktoattr1Bind a one-based attribute slot to external register storage.
| Opcode | Form | Effect |
|---|---|---|
0x00ce |
linktoattr1 rIndex,rObject,rTarget |
Use an integer register index. |
0x00cf |
linktoattr1 index,rObject,rTarget |
Use an integer literal index. |
The VM subtracts one from the index and applies linktoattr semantics. The
link is live and does not copy the target value into base attribute storage.
unlinkattr1 restores the retained base pointer.
Raises OUT_OF_RANGE for an index less than one or beyond the logical count.
.globals=0
main() .locals=2
setattrs r0,1
load r1,"external"
linktoattr1 1,r0,r1
unlinkattr1 1,r0
ret
linkattr1, unlinkattr1, linktoattr.
minattrsEnsure an object has at least a requested number of logical attributes without shrinking an existing larger object.
| Opcode | Form | Effect |
|---|---|---|
0x00dd |
minattrs rObject,rCount |
Use an integer register count. |
0x00de |
minattrs rObject,count |
Use an integer literal count. |
0x00df |
minattrs rObject,rBase,adjustment |
Require rBase + adjustment. |
0x00e0 |
minattrs rObject,base,adjustment |
Require the sum of two literals. |
If the requested count exceeds the logical count, new cleared, unlinked attribute storage is appended. Otherwise the object is unchanged. Existing attribute values and links are preserved.
The VM performs no explicit negative, overflow, or allocation signal check in these legacy forms. Portable RXAS must supply a nonnegative representable count; allocation failure is fatal rather than catchable.
.globals=0
main() .locals=1
setattrs r0,1
minattrs r0,3
ret
setattrs, getattrs, getabufs.
mkrefCreate a reference value that tracks a register’s current storage.
| Opcode | Form | Effect |
|---|---|---|
0x00c2 |
mkref rReference,rSource |
Point rReference at rSource storage. |
Existing links on rSource are resolved first, so the reference names the
currently bound storage. rReference is cleared before receiving the reference
payload. The target is marked for lifetime tracking and remains live while its
owning storage remains live.
Raises FAILURE with an out-of-memory message if a reference identity cannot
be allocated.
.globals=0
main() .locals=2
load r1,"value"
mkref r0,r1
ret
deref, linkref, unref.
refvalidProbe whether a reference payload still names live storage.
| Opcode | Form | Effect |
|---|---|---|
0x00c6 |
refvalid rResult,rReference |
Store integer 1 for a live reference, otherwise 0. |
The destination is cleared before receiving the Boolean. A non-reference,
cleared reference, or reference whose target lifetime ended returns 0.
rReference is unchanged.
This is the non-raising validity check and does not raise REFERENCE_INVALID.
.globals=0
main() .locals=3
load r1,"value"
mkref r0,r1
refvalid r2,r0
ret
mkref, unref, deref.
refsameCompare the retained storage identity of two reference values without dereferencing either operand.
| Opcode | Form | Effect |
|---|---|---|
0x0107 |
refsame rResult,rLeft,rRight |
Store integer 1 when both references retain the same identity cell, otherwise 0. |
The destination is cleared before receiving the Boolean. References created by
copying the same reference payload compare true, including after their common
target storage has expired. References to distinct storage compare false even
when the stored values are equal. A non-reference, cleared reference, or empty
reference has no identity and compares false. Neither operand is dereferenced
or modified; target validity is a separate refvalid question.
This is a non-raising identity check and does not raise REFERENCE_INVALID.
.globals=0
main() .locals=4
load r1,"value"
mkref r0,r1
copy r2,r0
refsame r3,r0,r2
ret
mkref, refvalid, unref, endlife.
setattrsSet an object’s exact logical attribute count.
| Opcode | Form | Effect |
|---|---|---|
0x00d8 |
setattrs rObject,rCount |
Use an integer register count. |
0x00d9 |
setattrs rObject,count |
Use an integer literal count. |
0x00da |
setattrs rObject,rBase,adjustment |
Set the count to a register plus a literal. |
0x00db |
setattrs rObject,base,adjustment |
Set the count to two literals’ sum. |
Growth appends cleared, unlinked attribute storage. Shrink resets removed values, restores their base storage bindings, invalidates references to that removed child storage, and may trim excess private capacity. Surviving attributes retain their values and bindings.
There is no explicit negative, overflow, or allocation signal check. Counts must be nonnegative and representable; allocation failure is fatal.
.globals=0
main() .locals=1
setattrs r0,3
ret
minattrs, getattrs, delattrs.
setobjtypeStamp a value with a concrete runtime object type and mark it initialized.
| Opcode | Form | Effect |
|---|---|---|
0x0038 |
setobjtype rObject,"fully.qualified.Type" |
Set runtime type metadata. |
The type name is a string constant retained by pointer from the module constant pool. Existing scalar, string, binary, decimal, attribute, reference, and status payloads remain intact. Any uninitialized-object marker is cleared.
This metadata update does not allocate or signal.
.globals=0
main() .locals=1
setobjtype r0,"example.Widget"
assertinitialized r0
ret
setobjuninit, typeof, assertinitialized.
setobjuninitReset a value to an empty typed object placeholder and mark it uninitialized.
| Opcode | Form | Effect |
|---|---|---|
0x0054 |
setobjuninit rObject,"fully.qualified.Type" |
Clear the value, set its type, and mark it uninitialized. |
Unlike setobjtype, this instruction first performs value_zero: existing
payloads, attributes, flags, references, and native payloads are cleared. It
then stores the constant-pool type name and sets the uninitialized marker.
The instruction itself does not signal. A later assertinitialized raises
OBJECT_NOT_INITIALIZED until initialization clears the marker.
.globals=0
main() .locals=2
setobjuninit r0,"example.Widget"
isinitialized r1,r0
ret
setobjtype, isinitialized, assertinitialized.
setrefCopy a complete value into storage named by a reference.
| Opcode | Form | Effect |
|---|---|---|
0x00c5 |
setref rReference,rSource |
Full-copy rSource into the reference target. |
The target receives all value payloads and attributes using normal full-copy semantics. The reference object and source are unchanged. Other aliases of the target observe the new value.
Raises REFERENCE_INVALID if the reference target is no longer live.
.globals=0
main() .locals=3
load r1,"before"
mkref r0,r1
load r2,"after"
setref r0,r2
ret
mkref, deref, linkref.
stemgetRead one string key from the private native stem representation.
| Opcode | Form | Effect |
|---|---|---|
0x0282 |
stemget rDst,rStem,rKey |
Copy the key’s current value or the current default into rDst. |
rStem owns a private versioned hash-table representation. A receiver with no
binary payload is initialized lazily. rKey is hashed and compared as exact
UTF-8 bytes; the key and stem are not modified. A stored entry from an older
default generation reads as the current default until that key is written
again. Destination replacement is allocation-failure atomic.
Raises UNICODE_ERROR for an invalid key, FAILURE for allocation failure,
capacity overflow, or corrupt private metadata.
.globals=0
main() .locals=4
steminit r0
load r1,"answer"
load r2,"42"
stemset r0,r1,r2
stemget r3,r0,r1
ret
stemget2, stemset, stemreset.
stemget2Read a two-segment key without materializing the joined key on the lookup path.
| Opcode | Form | Effect |
|---|---|---|
0x0285 |
stemget2 rDst,rStem,rLeft,rRight |
Read rLeft || "." || rRight. |
The VM streams both UTF-8 byte sequences and the single separator through the
same hash and equality contract as a materialized key. Hit and miss paths do
not allocate a key string. The logical key is therefore exactly equivalent to
one passed to stemget, including empty left or right segments.
Raises UNICODE_ERROR for either invalid segment and the same FAILURE
conditions as stemget.
.globals=0
main() .locals=5
steminit r0
load r1,"left"
load r2,"right"
load r3,"value"
stemset2 r0,r1,r2,r3
stemget2 r4,r0,r1,r2
ret
stemget, stemset2.
steminitInitialize an empty receiver for native stem operations.
| Opcode | Form | Effect |
|---|---|---|
0x0281 |
steminit rStem |
Create an empty generation-zero native stem. |
The receiver’s ordinary VM-owned binary payload holds the private little-endian header, 256 bucket heads, and fixed-width entry metadata. Three ordinary VM attribute values own insertion-ordered keys, insertion-ordered values, and the current default. These bytes are process-local value state, not an RXBIN section or public ABI. Initializing a receiver that already has a binary payload is corruption rather than a reset.
Raises FAILURE if the receiver already has binary state or if initial binary
or attribute storage cannot be allocated.
.globals=0
main() .locals=2
steminit r0
stemsize r1,r0
ret
stemget, stemset, stemreset, stemsize.
stemkeyatReturn a stored key by insertion-order position.
| Opcode | Form | Effect |
|---|---|---|
0x0288 |
stemkeyat rDst,rStem,rIndex |
Copy the one-based key at rIndex. |
Indexes are one-based and stable across default resets and existing-key updates. Keys are added only after an absent lookup is proved, so a failed insertion does not create an observable position. The destination receives a string copy; the stem is unchanged.
Raises INVALID_ARGUMENTS outside 1..stemsize, or FAILURE for allocation
failure or corrupt private metadata.
.globals=0
main() .locals=5
steminit r0
load r1,"first"
load r2,"value"
stemset r0,r1,r2
load r3,1
stemkeyat r4,r0,r3
ret
stemsize, stemvalueat.
stemresetReplace a stem’s default value in constant time.
| Opcode | Form | Effect |
|---|---|---|
0x0284 |
stemreset rStem,rDefault |
Copy the default and advance the generation. |
Reset scans no entries. It copies rDefault, then increments the receiver’s
64-bit generation. Existing keys remain in insertion order but read as the new
default until individually rewritten in the new generation. The default and
generation are unchanged if allocation fails; generation wrap is rejected.
Raises UNICODE_ERROR for an invalid default string and FAILURE for
allocation failure, generation overflow, or corrupt private metadata.
.globals=0
main() .locals=3
steminit r0
load r1,"missing"
stemreset r0,r1
load r2,"key"
stemget r2,r0,r2
ret
stemget, stemset, stemvalueat.
stemsetInsert or update one string key in a native stem.
| Opcode | Form | Effect |
|---|---|---|
0x0283 |
stemset rStem,rKey,rValue |
Set rStem[rKey] to rValue. |
An existing key is traversed once, its value is replaced, and its entry is stamped with the current generation. An absent key is materialized once and appended to insertion order after lookup. Key, value, receiver, and linked storage aliases retain ordinary VM value semantics. Allocation failures leave the logical entry count, bucket chains, values, and generation unchanged; successfully reserved private capacity may remain available for retry.
Raises UNICODE_ERROR for an invalid key or value and FAILURE for allocation
failure, capacity overflow, or corrupt private metadata.
.globals=0
main() .locals=3
steminit r0
load r1,"key"
load r2,"value"
stemset r0,r1,r2
ret
stemget, stemset2, stemreset.
stemset2Insert or update a two-segment key with a streamed lookup.
| Opcode | Form | Effect |
|---|---|---|
0x0286 |
stemset2 rStem,rLeft,rRight,rValue |
Set rStem[rLeft || "." || rRight]. |
Hashing and equality stream the two segments plus one separator. Existing-key
updates allocate no joined key. A new insertion materializes the canonical
joined key exactly once after absence is proved and otherwise follows
stemset generation, ordering, alias, and failure-atomicity rules.
Raises UNICODE_ERROR for either segment or the value and the same FAILURE
conditions as stemset.
.globals=0
main() .locals=4
steminit r0
load r1,"left"
load r2,"right"
load r3,"value"
stemset2 r0,r1,r2,r3
ret
stemget2, stemset.
stemsizeReturn the number of stored keys in a native stem.
| Opcode | Form | Effect |
|---|---|---|
0x0287 |
stemsize rCount,rStem |
Store the insertion-order entry count. |
The count includes entries from earlier default generations because their keys remain stored and extractable. Default resets and existing-key updates do not change it. An empty receiver is initialized lazily and returns zero.
Raises FAILURE for initial allocation failure or corrupt private metadata.
.globals=0
main() .locals=2
steminit r0
stemsize r1,r0
ret
stemkeyat, stemvalueat.
stemvalueatReturn a value by insertion-order position with generation-aware defaulting.
| Opcode | Form | Effect |
|---|---|---|
0x0289 |
stemvalueat rDst,rStem,rIndex |
Copy the one-based entry value. |
For an entry written in the current generation, the destination receives its
stored value. An older entry receives the current default, matching stemget
for the corresponding key. Extraction does not update the entry generation or
otherwise mutate the stem.
Raises INVALID_ARGUMENTS outside 1..stemsize, or FAILURE for allocation
failure or corrupt private metadata.
.globals=0
main() .locals=5
steminit r0
load r1,"first"
load r2,"value"
stemset r0,r1,r2
load r3,1
stemvalueat r4,r0,r3
ret
stemget, stemkeyat, stemreset, stemsize.
unlinkRestore a local register number’s original base storage binding.
| Opcode | Form | Effect |
|---|---|---|
0x00d5 |
unlink rLocal |
Replace the live binding with the frame’s base pointer. |
The value in aliased target storage is not copied into the restored local.
Instead, rLocal again exposes the storage allocated for that register when
the frame was created. Calling unlink on an already unlinked local simply
reassigns the same base pointer.
This instruction does not signal.
.globals=0
main() .locals=2
load r0,"base"
load r1,"target"
link r0,r1
unlink r0
ret
link, linkref, linkattr.
unlinkattrRestore a zero-based attribute slot’s original base storage binding.
| Opcode | Form | Effect |
|---|---|---|
0x00d0 |
unlinkattr rIndex,rObject |
Use an integer register index. |
0x00d1 |
unlinkattr index,rObject |
Use an integer literal index. |
The object’s active attribute pointer is reset to its retained base pointer. No value is copied from the external linked target, and that target is not cleared. Calling the instruction on an already unlinked attribute is harmless.
Raises OUT_OF_RANGE for a negative index or an index outside the logical
attribute range.
.globals=0
main() .locals=2
setattrs r0,1
load r1,"external"
linktoattr 0,r0,r1
unlinkattr 0,r0
ret
linktoattr, unlinkattr1, linkattr.
unlinkattr1Restore a one-based attribute slot’s original base storage binding.
| Opcode | Form | Effect |
|---|---|---|
0x00d2 |
unlinkattr1 rIndex,rObject |
Use an integer register index. |
0x00d3 |
unlinkattr1 index,rObject |
Use an integer literal index. |
After subtracting one from the index, the VM restores the retained base attribute pointer without copying the linked target’s current value.
Raises OUT_OF_RANGE for an index less than one or greater than the logical
attribute count.
.globals=0
main() .locals=2
setattrs r0,1
load r1,"external"
linktoattr1 1,r0,r1
unlinkattr1 1,r0
ret
linktoattr1, unlinkattr, linkattr1.
unrefClear a reference value and release its retain on the reference cell.
| Opcode | Form | Effect |
|---|---|---|
0x00c7 |
unref rReference |
Clear every value payload in the register. |
The register is reset to an empty value, not merely stripped of its reference payload. The referenced target storage itself is not overwritten or invalidated; other reference values remain usable.
This instruction does not signal, including when the register has no reference.
.globals=0
main() .locals=2
load r1,"value"
mkref r0,r1
unref r0
ret
mkref, refvalid, endlife.