On Sep 9, 2010, at 17:37, Robert A. Rosenberg wrote: > At 14:13 -0400 on 09/09/2010, Thomas David Rivers wrote about Re: > Negative displacements (was: Instruction Set Architectu: > >> NEGDISP CSECT >> USING -4096,R1 >> LA R3,-4(R2) >> LA R3,-4(,R2) >> >> I wonder why HLASM allows the negative displacement? >> The HLASM documentation (HLASM V1R6 Language Reference manual) >> for an "Ordinary USING" indicates: >> >> base >> specifies a base address, which can be a relocatable >> or an absolute expression. The value of the expression >> must lie between 0 and 2**31-1. >> >> and -4096 doesn't lie in that range... > > Yes it does. ASMH is treating the "USING -4096,R1" as "USING > NEGDISP-4096,R1" (ie: The 4096 bytes before the start of the CSECT). > Thus when you ask for -4 it is referencing NEGDISP-4 which is covered > by R1.
Nope. NEGDISP-4096 would be relocatable. -4096 is absolute. They're utterly different. It's astonishing how many otherwise sophisticated programmers harbor the delusion that the base of a USING must be relocatable while the Language Reference which Dave Rivers quoted above states clearly that the base may be either relocatable or absolute. > The problem is that it is not flagging the -4(,2) case since > there is no access to that area via R2. Yes. -- gil
