GPOP
Pop one or more garbage collector roots from the GP stack.
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $1F | 1 | 1 | GPOP | GPOP |
| $36 | 2 | 1 | GPOP {S_BYTE} | GPOP 123 |
Notes
-
The GP stack is used by the Hybrix memory manager to track GC roots for the purpose of garbage collection (GC). Each GC root stores the memory address of a pointer variable that should be analyzed by the garbage collector.
-
The GP stack grows backwards (pushing decreases the
GPregister), whereas the SP stack grows forwards. (The "top" of the GP stack is actually the lowest memory address.) -
GPOPundoes the action of GPUSH. The popped value is discarded because in practice it is not needed. (The GP stack contents are mainly inspected by the garbage collector, which will visit the stack usingLOAD.) -
Since the Hybrix hardware uses a 24-bit memory bus, Chombit's GP stack is configured to store 3-byte
TRIOpointers. -
The effect of
GPOPis to add 3 to theGPregister, because each stack record is a 3-byte pointer. -
GPOP 123is equivalent to 123GPOPinstructions. In other words, it adds 3 * 123 to theGPregister. -
This instruction does not affect the CPU condition flags.