Posted: Fri Jun 11, 2010 12:26 pm Post subject: HLASM - linkage,S0C4, wto help required
Hi,
I am new to assembler.
Please help with the following points:
1. I am trying to call an assembler prog PROGB from a COBOL prog PROGA.
In PROGA
Code:
CALL PROGB USING WS-PARMDATA
END-CALL
WS-PARMDATA is defined as pic x(10) in working storage.
In PROGB
Code:
PROGB CSECT
STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAVE+4
LA 13,SAVE
WTO 'START PROGB'
L 2,0(1)
USING PARMDATA,2
EXIT L 13,SAVE+4
LM 14,12,12(13)
BR 14
WTOR 'END PROGB'
SAVE DS 18F
PARMDATA DS CL10
END PROGB
Just trying to set the addressabilty of the passed parameter but it is abending with a S0C4 when trying to execute L 2,0(1).
How can I correct this or what is the correct way to pass a parameter to an assembler routine?
2. Can I use WTO to display the value of a variable? If not is there any other way this can be done.
If I were you, I would add ',ROUTCDE=11' to the first WTO, as without a ROUTCDE it's possible that the default is a routing code which you are not authorized to use, or which will bring other unintended consequences. ROUTCDE=11 will direct the WTO to your program log ( JESYSMSG ) dataset.
That being said, it is also possible that the SOC4 is a result of assembling/linking PROGB with AMODE=24 instead of AMODE=31, in which case addressability in PROGB could be the issue.
On another note: the final WTOR ( 'END PROGB') is wrong on two accounts:
1) WTOR is a write with a request for a Response ( typically from the console operator ) and could result in an automatic or operator initiated response that you will not appreciate.
2) Coding ANY instructions following the EXIT routine's 'BR 14' is a waste of time, since the program will have been exited before those instructions could possibly have been executed. If you want to issue a WTO for the exit message, it must be done BEFORE the 'L 13,SAVE+4' instruction ( and make it a WTO not a WTOR, and add 'ROUTCDE=11 ). _________________ A computer once beat me at chess, but it was no match for me at kick boxing.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum