On Friday, 08/01/2008 at 11:43 EDT, "Schuh, Richard" <[EMAIL PROTECTED]> 
wrote:
> I would have thought that "LA R15,32" would have been a better
> instruction to use than "L R15, =A(32)". I know that in olden days it
> burned less carbon. I don't know what the comparison with the LHI would
> be, but imagine that the two would be pretty close since both actually
> load the operands when the instruction is fetched, with no memory access
> needed.

Using LOAD ADDRESS requires that you learn all the little rules
- The operand has to be 0-4095  (it's a displacement)
- The maximum value of the register isn't what you think it is
- That maximum value is different in AMODE 24 than it is in AMODE 31
- There's no overflow protection with LA R1,10(,R1) since it isn't an 
arithmetic operation
- Don't forget the comma in (,R1)

If you could live with it, no problem, but it wasn't for the uninitiated. 
That's the nice thing about LHI, it was designed to load a number into a 
register, not an address.

Now if you want to increment a register by 10:
   AHI R1,10

Just hoping folks learned something new today.  I'll be the first to admit 
that these new (NOT!) instructions don't come naturally to my fingertips.

Alan Altmark
z/VM Development
IBM Endicott

Reply via email to