I don't know why I keep thinking about this but I believe I have a solution. It 
will give you exactly what you wanted, effectively DC A(=literal). It is a hack 
and a kludge and I would not do it myself, but I believe it will work.

A. Add a separate CSECT to your code following the record layout. Let's call it 
LITCSECT. Ahead of your table establish addressability on it with USING 
LITCSECT,0. Put a LTORG in the CSECT. That will collect all of your literals in 
that CSECT.

B. In your table, a three-step process. You might want to put this in a macro 
to avoid screwing it up. At each spot that you want your literal pointer:

1. DC A(LITCSECT)

That will generate an RLD so that whatever gets assembled into the word, at 
load time MVS will add the load address of LITCSECT to it.

2. ORG *-4
   LA 0,=literal

That will (a.) generate your desired literal following LTORG in LITCSECT; and 
(b.) overlay the A(LITCSECT) with 41000xxx where xxx is the offset of the 
generated literal into LITCSECT.

3. ORG *-4
   DC  X'0'
   ORG *+3

That will get rid of the 41.

So you now have 00000xxx in the table, where xxx is the offset of the literal 
into LITCSECT, and an RLD that at load time will relocate the word by the 
address of LITCSECT.

QED

Charles

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Windt, W.K.F. van der (Fred)
Sent: Monday, December 11, 2017 10:31 PM
To: [email protected]
Subject: Re: Address of a =LITERAL

> Is there some reason you can't just imbed the value in the structure, instead
> of introducing a level of indirection?  I could see using pointers for 
> variable-
> length strings, but the examples all show a 4-byte constant.

Ah, then the example was unfortunate: because those literals are pointers to 
varying length strings (a halfword length followed by the string value.

Fred!

-----------------------------------------------------------------
ATTENTION:
The information in this e-mail is confidential and only meant for the intended 
recipient. If you are not the intended recipient, don't use or disclose it in 
any way. Please let the sender know and delete the message immediately.
-----------------------------------------------------------------

Reply via email to