Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
reg/clr - Clear register
reg/clr register <, register ... >
reg/clr
Clears a list of registers ready for re-use. Memory claimed by the registers will be released. The P registers will be zeroed and the type set to PSUNIT_TYPE_NULL. The A, SCMP and SFLG registers will be set to #0.
If no arguments are provided, sets the SFLG register to #0.
This instruction additionally recognises the following buffers and data structures that will need memory to be freed before the registers can be safely released. Using reg/clr on any other data type has no effect other than zeroing the register.
Object edit buffers Edit buffers created with obj/def, obj/clone and obj/edit. See obj_def(5), obj_clone(5) and obj_edit(5). Walker structures Walkers initialised with reg/load indirect addressing. See reg_load_walker(5). Data segment read structures Read structures for data segments initialised with reg/load indirect addressing. See reg_load_segment(5). Data table read structures Read structures for binary data tables initialised with reg/load indirect addressing. See reg_load_table(5). Class read structures Read structures for object class lists initialised with class/load indirect addressing. See class_load(5). Attribute read structures Read structures for object attribute lists initialised with attr/load indirect addressing. See attr_load(5). Attribute value read structures Copy structures for object attribute values initialised with attr/copy indirect addressing. See attr_copy(5). String data Registers of type PSUNIT_TYPE_STRING that are unique copies of miscellaneous data stored as byte strings. Encoded data Registers of type PSUNIT_TYPE_XVALUE that are unique copies of encoded data. Note that when the stack is flushed using the stack/flush instruction, registers that are removed from the stack are also cleared using the same rules as defined above.
Registers with allocated memory are automatically freed as if reg/clr was called when a register is overwritten or when a function returns, so it is not strictly necessary to call reg/clr except as shorthand for zeroing a list of registers.
pal_commands(5), pal_registers(5), stack_flush(5), obj_def(5), obj_clone(5), obj_edit(5), reg_load_walker(5), reg_load_segment(5), reg_load_table(5), class_load(5), attr_load(5), attr_copy(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2018 Mark R. Bannister <cambridge@users.sourceforge.net>.
This is free software and can be downloaded from prose.sourceforge.net; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
PAL 1.0 | reg_clr (5) | 1 January 2018 |