The Punctilious Programmer IBM Mainframe Assembler The Difference Between Load and Load Address

The Difference Between Load and Load Address

Among other things, you need a sense of humor to be an assembler programmer, as the language presents you an unlimited number of opportunities for shooting yourself in the foot.  (Programmers think a lot about shooting themselves in the foot because it happens so often.)  Here are three ways to do just that in languages I’ve been using lately:

You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your foot.  After that’s done, you pull the trigger, the gun beeps several times, then crashes.

370 JCL
You send your foot down to MIS with a 4000-page document explaining how you want it to be shot.  Three years later, your foot comes back deep-fried.

After importing java.awt.right.foot.* and java.awt.gun.right.hand.*, and writing the classes and methods of those classes needed, you’ve forgotten what the hell you’re doing.

It seems that shooting our feet (It’s never just the one foot, is it?) is inevitable, and it’s easy enough to do with L or LA.  So, what exactly is the difference between Load (L) and Load Address (LA)?  Both instructions compute the address of operand 2.  LA simply puts the address in the operand 1 register.  But L, retrieves a fullword from memory – the one designated by the computed address – and puts that fullword in operand 1. But you probably already knew that.

There is another answer to this question that occurred to me in graduate school some thirty years ago.  I was struggling to fix the code for a multi-user mainframe operating system I was building.  It came to me in the form of a joke:

Question: What is the difference between Load and Load Address?
Answer: About a week’s work of debugging.

So now, whenever I code L or LA, I pause and give it an extra thought.  Over the years it’s a habit that has saved me many weeks of debugging.  It can help you, too.  In the heat of the battle, it’s tempting to just let the code fly and test later… after all, it’s all good, eh Joe?  But take my advice. Whenever you code, L or LA, take a sip of your favorite beverage, relax, and give it one extra thought.  Is it L or LA?  The answer is more important than you think.

Leave a Reply