On 2021-03-10, at 22:10:14, [email protected] wrote:
>     ...
>> 
>> You can use LA to subtract 1 if you have a negative value
>> in a base register, subject to the same limit.
> 
> Why would you do that, when BCTR R,0 will do it for free
> with even zero as the source register (you get true -1
> as a result). And besides, BCTR requires only 2 bytes,
> LA needs 4.
>  
What if you want to subtract 42?

I saw this done in some naively machine-generated code
targeted for s/370, which had only LA as an immediate
instruction.  The code dedicated a pair of base registers
for -4096 and -8192 to facilitate addressing control
block prefixes.  I suspect the author was most familiar
with PDP-11.

The code worked.

-- gil

Reply via email to