Why would anyone use the definition of ADDR2 shown below?

Why the question arose follows.

A recent problem reported to the z390 project
(Don Higgins' z390 assembler project) about an invalid
displacement generated in the "L 3,ADDR3" instruction
shown below. The problem boiled down to a z390 error
processing the statement "ADDR2 DC A(DWD+DWD)", which
does contain a complex relocatable expression. Sample
source provided by the user reporting the problem follows.

CPXRELEX CSECT
         USING CPXRELEX,15
         L     1,ADDR1
         L     2,ADDR2
         L     3,ADDR3
         BR    14
         ORG   CPXRELEX+X'100'
DWD      DS    D
ADDR1    DC    A(DWD)
ADDR2    DC    A(DWD+DWD)  Complex relocatable expression
ADDR3    DC    A(DWD+1)
         END

HLASM correctly assembles the sample source.

Running the program on z/OS, with the "BR 14" replaced by
"DC H'0'", shows (in the summary dump) registers 1, 2, and 3
set correctly (R1 contains the address of DWD, R2 = 2 * R1, and
R3 = R1 + 1).

The problem has been fixed in z390.

Thanks for any insight.

Reply via email to