The worst program update that I've ever seen was someone effecting a change in 
register conventions with

R5       EQU   7
R7       EQU   5

Instead of changing the registers in the remaining source code.

I'll admit to having used functional register names in my youth, but I came to 
the confusion that they caused more problems than they solved.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Wednesday, June 16, 2021 6:20 PM
To: [email protected]
Subject: Re: EXTERNAL: Coding for the future

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

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to