Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SOC1 Abend in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: SOC1 Abend in Assembler
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Mon May 16, 2011 6:26 pm    Post subject: Reply to: SOC1 Abend in Assembler
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    Post subject: SOC1 Abend in Assembler
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Mon May 16, 2011 6:43 pm    Post subject: Reply to: SOC1 Abend in Assembler
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    Post subject: SOC1 Abend in Assembler
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Mon May 16, 2011 6:56 pm    Post subject: Reply to: SOC1 Abend in Assembler
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    Post subject: SOC1 Abend in Assembler
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon May 16, 2011 7:06 pm    Post subject: Reply to: SOC1 Abend in Assembler
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    Post subject: SOC1 Abend in Assembler
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us