From: "Thomas David Rivers" <[email protected]> Sent: Friday, 10 September 2010 4:13 AM
Paul Gilmartin <[email protected]> wrote:Me too. A comparison: HLASM: Page 3 Active Usings: None Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2010/09/09 10.14 000000 00000 00008 1 NEGDISP CSECT R:1 FFF000 2 USING -4096,R1 000000 4132 1FFC FFFFFC 3 LA R3,-4(R2) 4 * 000004 4130 2FFC FFFFFC 5 LA R3,-4(,R2) 6 * 7 YREGS 7 YREGS -- gil
and, -4 is not in the range 0 through 4095. Even if you assume the assembler is simply wrapping-around and treating -4 as X'FFFFFFFC', X'FFFFFFFC' is not in the range 0 through 4095 either.
Look at the object code for the LA instructions. Note that -4 is x'FFFFFFFC". The assembler uses the least-significant 12 bits (which are FFC) and stores that in the displacement. FFC is, by definition, in the range 0 to 4095, as it's 4092.
