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

SOC4 abend in Assembler program


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: Thu Jun 16, 2011 4:02 pm
Reply with quote

I have written simple test program as below. I don't unerstand the reason for SOC4 abend.

Code:
TESTPGM2 START         
R0       EQU 0         
R1       EQU 1         
R2       EQU 2         
R3       EQU 3         
R4       EQU 4         
R5       EQU 5         
R6       EQU 6         
R7       EQU 7         
R8       EQU 8         
R9       EQU 9         
R10      EQU 10       
R11      EQU 11       
R12      EQU 12       
R13      EQU 13       
R14      EQU 14       
R15      EQU 15       
*        SAVE (14,12) 
         USING *,R15   
         BALR R15,R0   
         BCTR R15,R0   
         BCTR R15,R0   
         STM R14,R12,12(R13)       
         LA R14,SAVE18             
         ST R13,4(R0,R14)         
         ST R14,8(R0,R13)         
         LR R13,R14               
*        XR R0,R0                 
* MVZ INSTRUCTION                 
*                                 
         LA R3,OP1                 
         WTO 'DATA BEFORE MVZ'     
         WTO TEXT=(R3),ROUTCDE=11 
         MVZ 3(5,R3),2(R3)         
         WTO 'DATA AFTER MVZ'     
         WTO TEXT=(R3),ROUTCDE=11 
*  MVN INSTRUCTION                 
*                                 
         LA R4,OP2                 
         WTO 'DATA IN OP2 FOR MVN'
         WTO TEXT=(R4),ROUTCDE=11 
         LA R5,OP3                 
         MVN 2(4,R5),2(R4)         
         WTO 'RESULT OF MVN'       
         WTO TEXT=(R5),ROUTCDE=11 
***                                     
         LR R14,R13                     
         L  R13,4(R0,R14)               
         LM R14,R12,12(R13)             
         LA R15,0                       
*        BR R14                         
         RETURN (14,12),RC=0             
ERROR1   WTO 'END-OF-FILE REACHED'       
* DATA FIELDS FOR MNZ, MVN OPERATIONS   
OP1      DC H'06'                       
         DC CL6'1B3D5F'                 
OP2      DC H'04'                       
         DC CL4'7890'                   
OP3      DC H'06'                       
         DC CL6'123456'                 
TEMP1    DC H'03'           
         DC CL3' '         
*                           
SAVE18   DS 18F             
*                           
ADDFLD   DSECT             
OPERTNA  DC CL3' '         
FILLER1A DC C' '           
ADD1A    DC FL4'30'         
FILLER2A DC C' '           
ADD2A    DC HL2'20'         
FILLER3A DC C' '           
RESULTA  DC FL4'0'         
FILLER4A DC CL64' '         
*                           
         END               


Please let me know if anything wrong in the above code. Thanks[/i]
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jun 16, 2011 4:11 pm
Reply with quote

Possibly because you are using R15 as your base register but I believe things like WTO modify it. Use another register as your base register (R12 seems popular).
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: Thu Jun 16, 2011 4:29 pm
Reply with quote

Here's some similar advice from last time -

Code:

TESTPGM2 CSECT                     BEGIN CSECT
         SAVE (14,12)              SAVE REGISTERS
         BALR  R12,0               R12 IS BASE-REGISTER
         USING *,R12               INFORM ASSEMBLER
******** BCTR R15,R0   
******** BCTR R15,R0   
******** STM R14,R12,12(R13) 
******** LR R14,R13                     
         L  R13,4(,R13)            RESTORE CALLER'S R13
         XR R15,R15                ENSURE X'00'S
         RETURN (14,12),RC=(15)    RESTORE AND RETURN   
******** LR R14,R13                     
******** L  R13,4(R0,R14)               
******** LM R14,R12,12(R13)             
******** LA R15,0                       
******** BR R14                   

Any label in a DSECT defined as a "DC" is considered to be comments as they are treated as "DS".

You are overcomplicating things.

I will not post any more advice.

Bill
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Jun 16, 2011 6:40 pm
Reply with quote

I'm with Bill.

You seem to want to use the forum as a 'teach me' resource - which it is NOT!!.

Garry
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Thu Jun 16, 2011 11:04 pm
Reply with quote

looks as if no lessons learnt from ibmmainframes.com/about54725.html

disappointing...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 16, 2011 11:57 pm
Reply with quote

Hello Vinay,

You might be better served in our Student and Fresher Forum - www.ibmmainframeforum.com/

While we don't have the resources to "teach", some topics do go into some depth.
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 Using API Gateway from CICS program CICS 0
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top