Index | PAL Intro | Commands | Registers | Indices | Stack | Macros | Classes | Attributes | Errors
op/mask - Generate a 32-bit mask
Synopsis
Description
Error Handling
Examples
See Also
Author
op/mask write, #size
op/mask write, #cmp1, #cmp2
Generates 4-byte (32-bit) sequences useful for bitwise masking, using a combination of octets that have all the bits set (255) and octets that have no bits set (0).
In the first synopsis form, loads a 32-bit mask into the write register where the first size bytes of the mask will be 255 and the remaining bytes will be 0.
In the second synopsis form, loads a 32-bit mask into the write register where each byte of the mask will be 255 if the corresponding bytes of the registers cmp1 and cmp2 are equal, and 0 if they are not equal.
A runtime error is generated if a write argument is not a register or if a size, cmp1 or cmp2 argument is not a number (raw index) nor a register containing one.
op/mask P0, #3 Generates a mask in register P0 where the first 3 bytes have all their bits set (0xffffff00). op/mask PUSH, #0x10203040, #0x10223042 Compares the two 32-bit numbers byte-by-byte, generating the mask 0xff00ff00 where a byte only has all of its bits set if the corresponding byte in the two comparison values are equal. The mask is pushed onto the stack.
pal_commands(5), pal_registers(5), pal_indices(5), op_maths(5), op_swap(5), reg_cmp(5), reg_save(5),
PROSE Assembly Language at prose.sourceforge.net.
Copyright (c) 2002-2009 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 | op_mask (5) | 21 April 2009 |