Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors


Manual Reference Pages  - mtx_set (5)

NAME

mtx/set - Set value inside a matrix array

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

mtx/set ![matrix], dim, value

DESCRIPTION

Sets an element inside the matrix array identified by the matrix argument. The target element is identified by the dimensions dim, which take the same format as for the mtx/def instruction. See mtx_def(5).

The value is an argument containing the data to write to the target element. If value is a register containing the type PSUNIT_TYPE_STRING or PSUNIT_TYPE_XVALUE and the instruction does not generate an error, then the register will be cleared as the byte string is now referenced elsewhere.

If value is encoded data (PSUNIT_TYPE_XVALUE) and the data encoding is not of an appropriate syntax to be stored directly in the matrix array (this depends on the matrix array type), then it will be re-encoded as a byte string before processing.

If the value is PSUNIT_TYPE_NULL, then the element will be reset to its initial state (e.g. zeroed) and any memory allocated for it will be released.

Besides using mtx/set, it is also possible to set elements within a matrix array by using a matrix pointer as described in ps_matrix(5).

ERROR HANDLING

A runtime error is generated if an argument is of the wrong type, or if a referenced object does not exist in the nexus or does not point to a matrix array, or if dim is out of bounds.

EXAMPLES

mtx/set P0, @[#3, #0], #15
  Sets the element in index position (3, 0) in the matrix array pointed to by register P0 to the value 15.
mtx/set P3, #0, [Bannister]
  Sets the element in index position 0 in the matrix array pointed to by register P3 to the string "Bannister".

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), ps_attributes(5), ps_matrix(5), mtx_def(5), mtx_get(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

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 mtx_set (5) 17 January 2018
Generated by manServer 1.07 from man5/mtx_set.5 using man macros.