On Wed, 16 Jun 2021 16:48:43 +0000, Savor, Thomas wrote:
> ==> LA R7,5 Put 5 in register 7
>
>It depends on the intended target audience. Now I and you know that a 5 is
>put in Register 7, but many shops have only a couple Assembler
>Programmers....but many more Cobol programmers. Telling "them" that a 5 is
>put in Register 7 can be helpful to solving a problem or learning what a
>program does.
>
Indeed. And: " A little learning is a dangerous thing ;. ...".
Once, chasing a problem, I inspected some ISV code, apparently by
expert assembler programmers, but utterly mainframe-naive. They
gave registers mnemonic names:
LoopCount EQU 7
...
LA LoopCount,5
That's severely deprecated by mainframe experts.
They were accustomed to negative displacements and immediate
operands, but not to base registers. So:
LH RM4K,=H'-4096' (once in each module)
LH RM8K,=H'-8192'
...
LA POINTER,4096-5(POINTER,RM4K) Decrement POINTER by 5.
It works, within addressability range. John Ehrman and Dave Cole agreed
while noting that it would get pushback in a code review (as it did in
ASSEMBLER-LIST.)
They never coded a USING nor dedicated a base register. Their code teemed
with:
BALR RBASE,0 (Establish local addressability)
and convoluted algebra in storage accesses.
I think it was mechanically generated from a single source
for multiple target platforms. I could understand it once I
learned their conventions.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN