View previous topic :: View next topic
|
Author |
Message |
ajaypmenon
New User
Joined: 30 Mar 2007 Posts: 21 Location: North Carolina
|
|
|
|
Hi,
I have a program in which i am acquiring some storage using GETMAIN. Now we have mapped a dsect to that address.
Code: |
ASSM1 CSECT
STM 14,12,12(13)
BALR 11,0
USING *,11,12
LA 12,4095
LA 12,1(11,12)
GETMAIN RU,LV=2048
LR 7,1
USING TESTAREA,7
ST 13,SAVE+4
LA 13,SAVE
L 5,=A(BIN1)
L 13,SAVE+4
LA 0,2048
FREEMAIN RU,LV=(0),A=(1)
LM 14,12,12(13)
SR 15,15
BR 14
TESTAREA DSECT
PACK1 DS PL3
BIN1 DS F
SAVE DS 18F
END |
Now this program is not getting compiled. Can anybody lt me know what the reason is. The statement failing is L 5,=A(BIN1)
Thanks,
Ajay |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
What's the Assembly error you're getting for the load instruction of the ADCON?
A load address (LA) of the label BIN into R5 will also work and without generating a 4-Byte literal.
Bill |
|
Back to top |
|
|
ajaypmenon
New User
Joined: 30 Mar 2007 Posts: 21 Location: North Carolina
|
|
|
|
Hi Bill,
THanks a lot for the reply. Lemme tell you what i am doing. I wrote a macro which works as display statement in cobol. To pass the variables we need to send it as =A(BIN1,....) Thats the reason why i did it like that. As you said let me try the option you have suggested tomorrow. Its working properly in using all the cases except the dynamic memory allocation using getmain. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
an address constant can be resolved only for an absolute address ( in a CSECT )
BIN1 is defined in a dsect so You get the error |
|
Back to top |
|
|
ajaypmenon
New User
Joined: 30 Mar 2007 Posts: 21 Location: North Carolina
|
|
|
|
Hi Enrico,
Thanks for the reply. One quick question. It mite be a dumb question also. But as per my understanding, Even if use a memory in the CSECT if we check the asssembled code, we can see it as expanded using the base register. That will also be relative address. The time compilation happens we dont know what will be the address of base register. It gets the address only when its loaded to main memory. So why this code is not able to handle this. Please let me know. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
What Enrico was referring to as an "Absolute Address" means that the label BIN would need to be a constant (IE: A DC as opposed to a DS), based under one of the CSECT Base Registers.
I missed that little "tidbit" too!
The Load Address should work as a substitute.
Regards,
Bill |
|
Back to top |
|
|
ajaypmenon
New User
Joined: 30 Mar 2007 Posts: 21 Location: North Carolina
|
|
|
|
Thanks a lot for the replies.
I think i got it. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
What Enrico was referring to as an "Absolute Address" means that the label BIN would need to be a constant (IE: A DC as opposed to a DS), based under one of the CSECT Base Registers. |
not necessarily, it can be also a DS as long as its address can be computed as an absolute value...
a csect will be processed by the loader and once loaded will alway reside at the same address
so the addresses can be resolved at load time
a dsect will not be loaded by anybody, so no address computation will ever be carried out |
|
Back to top |
|
|
|