%WHERE (assembler, disassembly, and LangX COBOL)

Returns a string that describes the named area (if any) whose address is specified as the operand. %WHERE can be used only as the outermost expression in the LIST command.

Read syntax diagramSkip visual syntax diagram%WHERE(expression) ;
expression
An expression that evaluates to a hexadecimal value that is one to four bytes in length.

The following rules are used to evaluate the value of the expression, in the order listed:

  1. If the expression value is less than 4096, a decimal number is returned.
  2. If the expression value is an address within any known compile unit, the name of the compile unit with a hexadecimal offset is returned.
  3. If the expression value is within 4095 bytes of the value in a general register and a USING is in effect for that register, the name of the DSECT that corresponds to the USING instruction with a hexadecimal offset is returned.
  4. A hexadecimal number representing the expression value is returned.

Although this function can be used only within an assembler, disassembly, or LangX COBOL compile unit, the expression can evaluate to a compile unit in any language.

Usage note

You cannot nest %WHERE into another expression. For example, the following command is not valid:

LIST %WHERE(X'14B0')||'ABC'
Examples
  • Assuming that CSECT ROUTINE1 is located at address X'1BC0400', the following command returns "ROUTINE1+X'2A'":
    LIST %WHERE(X'1BC042A')
  • Assume that register R3 contains X'1C4A0' and that the program is stopped at the instruction  highlighted  in the following lines of code:
          USING   DATA1,R3
          …
           SLR   R0,R0 
          …
    
    DATA1 DSECT ,
    …
    The command LIST %WHERE(X'1C4B4') returns DATA1+X'14'.
  • The command LIST %WHERE(X'100') returns 256.
  • If the expression cannot be resolved to a known location, the command LIST %WHERE(X'1B5C4') returns X'1B5C4'.