On Wed, 18 Aug 2010 23:27:30 -0600, Paul Gilmartin wrote:

>On Aug 18, 2010, at 17:30, John R. Ehrman (408-463-3543 T/543-) wrote:
>
>> I think the original posting was pointing out that you lose only
>> a single byte of addressability by adding 4095, and that you save
>> one instruction. The added byte is rarely an issue; whether or not
>> the extra instruction is important depends on the application.
>>
>Making the CSECT 4 bytes longer to gain 1 byte of addressability
>leaves you 3 bytes worse off.

There are several methods of establishing that second base register.  The
original posted method of using LA to add 4095 is one instruction, four
bytes.  Two LA instructions to get an offset of 4096 is two instructions,
eight bytes.  LAY is one instruction, six bytes.  LR and AHI is two
instructions, six bytes.  LARL is one instruction, six bytes.

As David pointed out, sometimes it is better for the second base register to
be 4096 greater than the first.  I'll gladly take a one byte penalty for
improved maintainability.

--
Tom Marchant

Reply via email to