On Mon, Nov 3, 2014 at 12:56 PM, Mark Boonie <[email protected]> wrote:
> I recently started looking at the 'end' specification for the USING > statement, something I've neglected for a long time. I *thought* it > indicated the last location that could be assembled with that USING, but > I'm not so sure any more. I have the following source file: > > <snip> > > > The last sentence of the description of the 'end' specification for an > ordinary USING says, "Thus USING base,reg is equivalent to USING > (base,base+4096),reg." So, my thinking was as follows: > > - Since a "default" USING can only be used up to base+4095 (because the > maximum 4K displacement is x'FFF'), I assume this means that the > 'base+4096' points to the byte *past* the last valid USING location. > False statement! What is confusing you is that some instructions, such as the LG you are using, don't use 12 bit offsets but use the new zArchitecture "long displacement" which uses 20 bit offsets. So, for long displacement instructions, the range is from -524,288 to +524,287 (1 megabyte) from the base. Page 1-16 of the -9 version of the PoPS goes into this. <quote> Long-Displacement Facility The long-displacement facility provides a 20-bit signed-displacement field in 69 previously existing instructions (by using a previously unused byte in the instructions) and 44 new instructions. A 20-bit signed displacement allows relative addressing of up to 524,287 bytes beyond the location designated by a base register or base-and-index-register pair and up to 524,288 bytes before that location. The enhanced previously existing instructions generally are ones that handle 64-bit binary integers. The new instructions generally are new versions of instructions for 32-bit binary integers. The new instructions also include (1) a LOAD BYTE instruction that sign-extends a byte from storage to form a 32-it or 64-bit result in a general register and (2) new floating-point LOAD and STORE instructions. The long-displacement facility provides register-constraint relief by reducing the need for base registers, code size reduction by allowing fewer instructions to be used, and additional improved performance through removal of possible address-generation interlocks. (June, 2003) <quote> > - If the previous item is true then the "Active Usings" line that shows a > range of x'1770' bytes for 'dummy' would mean that the last valid address > that can use R1 as a base is dummy+5999. > > - If the previous item is true then the LG of FAR3 at location x'C' should > not successfully assemble because FAR3 is at DUMMY+6000. > > - Even if there is a confusion between "1 byte prior to the specified end" > vs. "the specified end", the LG for FAR4 at location x'12' should certainly > fail. > > Since the LG of FAR4 didn't fail, my understanding of the function of the > 'end' specification must be a misunderstanding. Can anyone offer any > clarity? Thanks. > Your understanding for the USING is absolutely correct. As mentioned above, your misunderstanding is (ignorance of?) the existence of the long displacement facility. > > - mb > -- The temperature of the aqueous content of an unremittingly ogled culinary vessel will not achieve 100 degrees on the Celsius scale. Maranatha! <>< John McKown
