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

0C1 for an assembler newbie


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

New User


Joined: 20 Dec 2006
Posts: 2
Location: France

PostPosted: Wed Dec 20, 2006 7:20 pm
Reply with quote

Hi,

I'm a newbie in assembler and i have a problem to resolve a 0C1 in my 1st assembler program. Here is the code :

TEST02 CSECT
SAVE (12,14)
BALR R12,0
USING *,R12
LA R2,SAVEAREA
ST R2,8(,R13)
ST R13,SAVEAREA+4
L R13,SAVEAREA+4
RETURN (14,12),RC=0
SAVEAREA DC 18F'0'
YREGS
END

Normally, this program just takes the control and returns the control to the environment.
When i assembly, i've got an 0 return code, but when i execute it, i have a 0C1 :

IEA995I SYMPTOM DUMP OUTPUT 790
SYSTEM COMPLETION CODE=0C1 REASON CODE=00000001
TIME=14.47.09 SEQ=39036 CPU=0000 ASID=032B
PSW AT TIME OF ERROR 078D0000 00000002 ILC 2 INTC 01
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00000000 - 000A0000 000130E1 00000000
GR 0: 00000000 1: 00000000
2: 00000000 3: 00000000
4: 00000000 5: 00000000
6: 00000000 7: 00000000
8: 00000000 9: 00000000
A: 00000000 B: 00000000
C: 00E96742 D: 00006F60
E: 00000000 F: 00000000
END OF SYMPTOM DUMP

//TEST02 EXEC PGM=TEST02
//STEPLIB DD DISP=OLD,DSN=ITRVISA.$0DTAP0A.LOAD
//SYSABEND DD SYSOUT=*

I assembly / link this program in 24 or 31 mode but i've still a 0C1.

Can anyone help me ?

Alex.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Dec 20, 2006 7:36 pm
Reply with quote

That PSW looks a lot like a branch to low core.......
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Dec 20, 2006 8:32 pm
Reply with quote

Hi !

At ProgrammStart you issued an SAVE 12,14 and at ProgrammEnd the
correct RETURN 14,12.

So first, you only stored r12,r13 and r14 in the upper saveare. Then you reloaded r14,r15,r0,r1,...up tp r15 and did a BR r14. That causes the StorageViolation.

First you have to store all regs from the upper programm, in your case, the base environment. Then initiate your own savearea. So you have to take care of the correct forward/backward chain.

Without using IBM macros save & return you could code it like this:


MDL00910 CSECT
STM R14,R12,12(R13) ...STORE IN UPPER SAVEAREA
SPACE
BALR R09,0 ...SET R9 AS BASE-REGISTER
USING *,R9
SPACE
USING MDL00910_PARAMETER,R2 ...SET R2 AS DSECT PARM
L R2,0(R1) (ONLY IF THER IS ANY)
SPACE
LA R15,MDL00910_SAVEAREA ...LOAD OWN PGM-SAVEAREA
ST R15,8(R13) ...STORE ADR IN UPPER SAVE
ST R13,4(R15) ...STORE UPPER IN OWN SAVE
LR R13,R15 ...CHANGE ADRESSES
SPACE
B *+4+4+18*4
SPACE
MDL00910_SAVEAREA DC 18F'0' ...PROGRAMM-SAVE-AREA
SPACE
B MDL00910_START

MDL00910_START DS 0H
...JUST DO SOMETHING

MDL00910_ENDE DS 0H
L R13,MDL00910_SAVEAREA+4 ...LOAD BACK ADRESS
LM R14,R12,12(R13) ...RELOAD ALL REGISTERS
SR R15,R15 ...CLEAN R15 FOR RC=0
BR R14 ...GO BACK TO WHERE YOU COME




Hope that help's, Regards, UmeySan
Back to top
View user's profile Send private message
alex.

New User


Joined: 20 Dec 2006
Posts: 2
Location: France

PostPosted: Wed Dec 20, 2006 8:42 pm
Reply with quote

Thank you, UmeySan. I just replace save(12,14) by save(14,12) and it's OK. I think I have to be more rigorous in the future. icon_redface.gif

Alex.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Dec 20, 2006 9:38 pm
Reply with quote

Hi Alex !

It had been a peasure to help you.

Avec plaisir !

Regards & Amiti?s, UmeySan
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 Build dataset list with properties us... PL/I & Assembler 4
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts How Can I Recall a Migrated Data Set ... PL/I & Assembler 3
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
Search our Forums:

Back to Top