View previous topic :: View next topic
|
Author |
Message |
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Hi,
I am trying to execute my first Assembler program. I am facing SOC1 abend. Its a simple program am trying, without any functionaly.
Code
TESTPGM START
R0 EQU 0
R4 EQU 4
R15 EQU 15
USING *,R15
BALR R15,R0
BCTR R15,R0
BCTR R15,R0
END
I think SOC1 means invalid machine instruction. Can anyone suggest me what s wrong with above piece of code? Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
where is the <return> stuff ..
as is Your instruction sequence falls thru the <garbage> after the instructions |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
I am not returning any value back. Do I need to write 'RETURN' just before the 'END' statement? Sorry might be silly question to ask. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
how do You expect control to get back to the operating system ???
assembler is not a block structured language where falling thru the block end is understood as an implicit return ! |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
After giving the RETURN instruction just before END, Now the Job is abending with return code '4088'
TESTPGM START
R0 EQU 0
R4 EQU 4
R15 EQU 15
USING *,R15
BALR R15,R0
BCTR R15,R0
BCTR R15,R0
RETURN
END |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
learn to distinguish between an abend and a return code
You should remember that register 15 is one of the <reserved> registers
using it as a long term base register is improper |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Thanks Enrico.
I added the instruction DROP R15 before return and also used RETURN,RC=0. Both these didn't work.
I tried using different register instead of R15, still I got the same abend.
Can you please suggest? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
The rules I normally follow are -
Base-Register = R3
R15 is used to return a return-code. Commonly, when all is well, issue an XR R15,R15.
Return to the caller via R14.
Review the Assembler SAVE and RETURN Macros or look for them in previous posts.
Stay away from R12 as a Base-Register because if you need to make the program LE compliant in the future, R12 points to the LE "CAA" (Common Anchor Area).
Bill |
|
Back to top |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Thanks a lot.
I made R15 to have ZERO by SR R15,R15 and the job ran fine. |
|
Back to top |
|
|
|