Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
reg/index - Lookup internal index number
reg/index write, &[.codeptr] <, write, &[.codeptr] ... >
reg/index write, &[~dataptr] <, write, &[~dataptr] ... >
Returns in the write registers a raw index number identifying the position of the given code section codeptr or data segment dataptr within their respective data tables. These index numbers can then be used with reg/load indirect addressing to read code or data pointers. See reg_load_table(5).
Note that it is more efficient to supply the codeptr or dataptr arguments by name so that the index can be read directly from the instruction code, rather than supplying them through registers. If supplied by a register, the data tables have to be scanned for the address to convert it back into an index, which is less efficient.
The reg/index instruction takes multiple pairs of arguments.
pal_commands(5), pal_registers(5), pal_indices(5), reg_load_table(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2008 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_index (5) | 9 November 2008 |