REXX Language implementation
These instructions copy, transfer, clear, load, or bind register values. Scalar loads change only their named payload unless stated otherwise; full-value copy and move include every payload, attribute, type, flag, and reference association.
acopyCopy the complete status-flag word between values.
| Opcode | Form | Effect |
|---|---|---|
0x000d |
acopy rDestination,rSource |
Copy all internal and public flags. |
Only rDestination’s status word changes. This includes VM-private validity
flags as well as compiler, library, user, and reserved bands; payloads,
attributes, and type metadata are untouched. The source is
unchanged.
This instruction does not signal.
.globals=0
main() .locals=2
setortp r1,65536
acopy r0,r1
ret
copy, icopy, scopy, gettp.
copyDeep-copy a complete value while leaving the source intact.
| Opcode | Form | Effect |
|---|---|---|
0x0008 |
copy rDestination,rSource |
Replace destination with an independent copy. |
The destination’s existing storage is replaced by copies of scalar, decimal, string and binary payloads, attributes recursively, object type, status flags, and reference payload/identity state. Mutable buffers and attributes are not aliased to the source. Self-copy is safe.
There is no translated VM signal; allocation failure is fatal.
.globals=0
main() .locals=2
load r1,"value"
copy r0,r1
ret
move, load, acopy.
eraseReset a register to the VM’s empty value state.
| Opcode | Form | Effect |
|---|---|---|
0x01fc |
erase rValue |
Clear every value component. |
The register releases or clears scalar storage, decimal/string/binary payloads,
attributes, object type, flags, and reference associations, then
becomes a zero/empty value. The operation is semantically the same as null.
This instruction does not signal.
.globals=0
main() .locals=1
load r0,"temporary"
erase r0
ret
null, move, endlife.
loadLoad a scalar literal or bind one register slot to another.
| Opcode | Form | Effect |
|---|---|---|
0x0001 |
load rDestination,integer |
Set integer payload. |
0x0002 |
load rDestination,float |
Set float payload. |
0x0003 |
load rDestination,"string" |
Set string payload from constant. |
0x0004 |
load rDestination,rSource |
Rebind destination slot to source value. |
0x0005 |
load rDestination,decimal |
Parse decimal constant through the plugin. |
0x0006 |
load destinationIndex,sourceIndex |
Rebind raw numbered register slots. |
0x0007 |
load destinationIndex,rSource |
Bind raw numbered slot to register value. |
0x00b7 |
load rDestination,binary |
Replace binary payload with literal bytes. |
Integer and float forms write only that scalar payload. String and binary forms replace their payload. Decimal form replaces the decimal payload using the current decimal context. Register forms change the frame’s register-pointer table persistently: later reads and writes through the destination access the same complete value as the source until another binding operation changes it; they are not copies. Raw indexes are zero-based and are not checked.
Binary allocation failure raises FAILURE. Decimal parsing propagates the
decimal plugin’s signal. Other forms do not signal; invalid raw register indexes
are not translated into a VM signal.
.globals=0
main() .locals=1
load r0,42
ret
copy, link, unlink, loadsettp.
loadsettpLoad a scalar literal and set its externally writable status flags atomically.
| Opcode | Form | Effect |
|---|---|---|
0x0206 |
loadsettp rDestination,integer,flags |
Load integer and replace public flags. |
0x0207 |
loadsettp rDestination,float,flags |
Load float and replace public flags. |
0x0208 |
loadsettp rDestination,"string",flags |
Load string and update public flag bands. |
Only compiler, library, and user flag bands are writable. Integer and float forms replace all public-writable flags with the masked literal and discard VM-private/reserved bits. The string form replaces its payload but uses band-aware public write: VM-private flags survive, a zero public request clears all public bands, and nonzero requested bands replace only those bands. Other payloads and attributes remain intact.
These forms do not signal; string allocation failure is fatal. Bits outside the public-writable masks are ignored.
.globals=0
main() .locals=1
loadsettp r0,7,65536
ret
load, settp, setortp, gettp.
moveTransfer a complete value and its owned storage to another register.
| Opcode | Form | Effect |
|---|---|---|
0x01fd |
move rDestination,rSource |
Move the value, then reinitialize source. |
The destination’s old storage is destroyed, then all scalar payloads, buffers, attributes, type metadata, flags, and reference associations transfer from the source. The source becomes an empty initialized value. When both operands resolve to the same value, the instruction is a no-op. This mnemonic is retained for source compatibility but marked deprecated by the VM.
This instruction does not signal.
.globals=0
main() .locals=2
load r1,"value"
move r0,r1
ret
copy, erase, swap.
nullReset a register to the VM’s empty value state.
| Opcode | Form | Effect |
|---|---|---|
0x000e |
null rValue |
Clear every value component. |
All payloads and owned storage, attributes, object metadata,
status flags, and reference associations are cleared or released. The register
remains allocated and can be reused immediately. This has the same runtime
implementation as erase.
This instruction does not signal.
.globals=0
main() .locals=1
load r0,9
null r0
ret
erase, move, endlife.