Defining ANCHOR Words

Use the QUERY parameter to retrieve the contents of a previously set anchor word.

Example 1— To query an Anchor word named ABC, code the ANCHOR macro as
ANCHOR QUERY,IDENT=ABC,ERROR=(R2)
In this example, QUERY checks to see if an anchor slot has been assigned for ABC. If it has, QUERY returns the anchor word in register 1. If ABC is not found, the routine specified in the ERROR parameter is run.

Use the SET parameter to declare an Anchor word.

Example 2— To declare an Anchor word named ABC, code the ANCHOR macro as
ANCHOR SET,IDENT=ABC,ERROR=(R2),VALUE=(R7)
In this example, SET initializes the anchor word to the value specified in register 7. If VALUE is omitted, the anchor word is set to zero.

Use the CLEAR parameter to delete an anchor word from the list of anchor slots.

Example 3— To clear an anchor word named ABC, code the ANCHOR macro as
ANCHOR CLEAR,IDENT=ABC,ERROR=(R2)
In this example, CLEAR checks to see if an anchor slot has been assigned for ABC. If it has, CLEAR sets the anchor identifier and the anchor word to binary zeros. If ABC is not found, the routine specified in the ERROR parameter is executed.