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


Manual Reference Pages  - obj_cmp (5)

NAME

obj/cmp - Compare objects

CONTENTS

Synopsis
Description
Error Handling
Examples
See Also
Author

SYNOPSIS

obj/cmp ![cmp1], ![cmp2] <, attribute, attribute ... >

DESCRIPTION

Compares the attribute values assigned to a pair of objects, storing the result of the comparison in the SCMP and SFLG registers.

If no attribute argument is provided, all attributes assigned to the objects are compared. Otherwise only the listed attributes are compared.

The result of the comparison can be any of the test results described in pal_registers(5).

If an attribute assigned to one object is not assigned to the other, the result of the comparison will always be PSCMP_NOTEQUAL.

Note that this instruction does not compare classes. To test if a class is assigned to an object, use the class/test instruction. See class_test(5).

If unlike attributes are to be compared between objects, use the attr/cmp instruction instead. See attr_cmp(5).

ERROR HANDLING

A runtime error will occur if an attribute is of a type for which comparison is not supported, or if a referenced object does not exist.

EXAMPLES

obj/cmp ![obj1], ![obj2]
  Tests the attributes assigned to two objects underneath the context root (PCTX). The SCMP register will contain the result of the comparison while the lowermost bit of the SFLG register will tell you whether the comparison tested true for equality.
obj/cmp ![-data], P2, [psString]
  Compares the psString attribute assigned to an object attached to the module root and an object pointed to in register P2.

SEE ALSO

pal_commands(5), pal_registers(5), pal_indices(5), attr_cmp(5), class_test(5), attr_test(5), attr_mvtest(5), reg_cmp(5),
PROSE Assembly Language at prose.sourceforge.net.

AUTHOR

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 obj_cmp (5) 23 October 2009
Generated by manServer 1.07 from man5/obj_cmp.5 using man macros.