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
 

 

0C1 for an assembler newbie

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: 0C1 for an assembler newbie
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: 3158
Location: Tucson AZ

PostPosted: Wed Dec 20, 2006 7:36 pm    Post subject:
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: 743
Location: Germany

PostPosted: Wed Dec 20, 2006 8:32 pm    Post subject: Re: 0C1 for an assembler newbie
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    Post subject:
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: 743
Location: Germany

PostPosted: Wed Dec 20, 2006 9:38 pm    Post subject:
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    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 A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
This topic is locked: you cannot edit posts or make replies. MVS Assembler profiles for Pune Locat... shailesh_do Mainframe Jobs 0 Mon Feb 22, 2016 6:21 pm
No new posts ASRA abend calling Assembler from CICS surya8 PL/I & Assembler 13 Thu Sep 10, 2015 7:50 pm
No new posts Is Enterprise PL/I v4.2 compatible wi... sundarkudos PL/I & Assembler 2 Wed Aug 19, 2015 11:15 pm


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