IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SOC1 Abend in Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Mon May 16, 2011 6:24 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 6:26 pm
Reply with quote

where is the <return> stuff ..
as is Your instruction sequence falls thru the <garbage> after the instructions
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Mon May 16, 2011 6:38 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 6:43 pm
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Mon May 16, 2011 6:51 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 16, 2011 6:56 pm
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Mon May 16, 2011 7:03 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon May 16, 2011 7:06 pm
Reply with quote

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
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue May 17, 2011 10:58 am
Reply with quote

Thanks a lot.

I made R15 to have ZERO by SR R15,R15 and the job ran fine.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts How Can I Recall a Migrated Data Set ... PL/I & Assembler 3
Search our Forums:

Back to Top