IBM Support

How to cause literals to be halfword aligned.

Troubleshooting


Problem

This instruction gives an error 50% of the time LARL 1,=C'HELLO'

Symptom

ASMA058E Invalid relative address.

Cause

The literal table does not guarantee half word alignment for each literal within it. The LARL requires the alignment.

Resolving The Problem

The LTORG instruction aligns the literal table on a double word boundary. Therefore, you can use it as in this example. The second LTORG will cause the Hello to appear on a double word boundary. Assemble this yourself and look at the addresses.
Code     CSect ,          
         Using *,15      
         LA    1,=X'34567'
         LA    2,=X'123'  
Literals LOCTR            
         LTORG            
Code     LOCTR            
         LARL  1,=C'Hello'
Literals LOCTR            
         LTORG            
         End              

[{"Product":{"code":"SSENW6","label":"High Level Assembler and Toolkit Feature"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Assembler","Platform":[{"code":"PF038","label":"z\/VSE"},{"code":"PF035","label":"z\/OS"},{"code":"PF037","label":"z\/VM"},{"code":"PF016","label":"Linux"}],"Version":"1.5;1.6","Edition":"","Line of Business":{"code":"","label":""}}]

Historical Number

PMR94055_422_000

Document Information

Modified date:
02 August 2018

UID

swg21393448