|
|
| Author |
Message |
quest2008
New User
Joined: 12 Jun 2008 Posts: 7 Location: bangalore
|
|
|
|
Hi,
I have a basic qestion. Could anyone explian what is purpose of declaring multiple CSECT inside a single assembler program, instead of keeping them in separate file.
Thanks |
|
| Back to top |
|
 |
References
|
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8639 Location: 221 B Baker St
|
|
|
|
Hello quest2008 and welcome to the forums,
| Quote: |
| Could anyone explian what is purpose of declaring multiple CSECT inside a single assembler program |
One reason was to reduce the number of modules that had to be managed/distributed. Another was to reduce the number of modules that had to be apf-authorized (if the code needed this). |
|
| Back to top |
|
 |
quest2008
New User
Joined: 12 Jun 2008 Posts: 7 Location: bangalore
|
|
|
|
Hi Dick,
Thanks a lot.
I have a requirement to combine the CSECTs from different file into single CSECT.
I have some sample code and i am facing SOC4 abend while giving control back to previous CSECT. I have experience in writing programs with single CSECT.
I write the save area logic which is similar to calling another subroutine.
I am not aware what are things i should take care while combing the CSECTs in different file into single CSECT as comparing to calling another CSECT in different library.
(ie giving control to another CSECT, calling CSECT from another CSECT,SAVE area.)
ie giving control to another CSECT, calling CSECT from another CSECT,SAVE area.
MAINPG11 CSECT
***********************************************************************
MAIN1 STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAVE+4
LA 13,SAVE
*
LA 1,PARM01
L 15,SUB
BALR 14,15
LR 4,0
CVD 4,WSDW
UNPK WSCHAR,WSDW
OI WSCHAR+L'WSCHAR-1,X'F0'
MVC MSG+2(L'WSCHAR),WSCHAR
LA 3,MSG
WTO TEXT=(3)
***********************************************************************
EXIT1 L 13,SAVE+4
L 14,12(0,13)
LM 0,12,20(13)
BR 14
DROP 12
***********************************************************************
* STORAGE SECTION
***********************************************************************
SAVE DS 18F
PARM01 DS 0H
DC A(P1)
DC A(P2)
DC A(P3)
P1 DC F'100'
P2 DC F'200'
P3 DC F'210'
WSDW DS D
WSCHAR DS CL8
MSG DC AL2(16)
DS CL16
SUB DC V(SUBPG11)
SUBPG11 CSECT
MAIN2 STM 14,12,12(13)
USING SUBPG11,15
ST 13,SUBSAVE+4
LA 13,SUBSAVE
LR 3,1
LM 4,6,0(3)
L 7,0(,4)
L 8,0(,5)
L 9,0(,6)
AR 7,8
AR 7,9
LR 1,7
L 15,SUB12
BALR 14,15
WTO 'CALL0'
ES EQU *
***********************************************************************
*
***********************************************************************
EXIT2 L 13,SUBSAVE+4
L 14,12(0,13)
LM 1,12,24(13)
BR 14
***********************************************************************
* STORAGE SECTION
***********************************************************************
SUBSAVE DS 18F
WSFW DS F
SUB12 DC V(SUBPG12)
SUBPG12 CSECT
STM 14,12,12(13)
USING SUBPG12,15
LR 3,1
AR 3,3
LR 0,3
L 14,12(0,13)
WTO 'CALL1',ROUTCDE=11
LA 15,0
LM 1,12,24(13)
WTO 'CALL2',ROUTCDE=11
BR 14
WTO 'CALL3',ROUTCDE=11
DROP 15
* LTORG
END MAINPG11
In the spool the 'CALL1' get displayed , so the abend is occuring at this point after L instruction. |
|
| Back to top |
|
 |
quest2008
New User
Joined: 12 Jun 2008 Posts: 7 Location: bangalore
|
|
|
|
Hi,
The above problem mentioned has been solved. This is because of destruction of base address at BALR indtruction. Thanks a lot. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8639 Location: 221 B Baker St
|
|
|
|
Good to hear that it is working.
Thank you for letting us know
d |
|
| Back to top |
|
 |
|
|
|