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 Profile Log in to check your private messages Log in
 
Assembler calling cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Avinashhlg

New User


Joined: 05 Jan 2010
Posts: 7
Location: Bangalore

PostPosted: Wed Jan 13, 2010 4:48 pm    Post subject: Assembler calling cobol
Reply with quote

I have coded an assembler program which reads a QSAM dataset, and passes the data to the COBOL program. I am able to call the program without accessing the file, but if I put OPEN, READ macro, the program abends with S0C4 abend. What could be wrong?

1.
OPEN (SYS102,OUTPUT)
L 15,=V(CTEST)
BSM 14,15
Gives me S0C4

2.
L 15,=V(CTEST)
BSM 14,15
executes successfully
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Wed Jan 13, 2010 4:59 pm    Post subject: Reply to: Assembler calling cobol
Reply with quote

I wish people would stop hiding things...
the parameter passing convention usually is ....

r15 address of the called module
r14 address of the return address
r1 address of the parameter list

hint
check the register use from the Open macro
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8151
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jan 13, 2010 7:20 pm    Post subject:
Reply with quote

From the POP:
Quote:
2. BRANCH AND SET MODE with an R1 field of
zero is intended to be the standard return
instruction in a program entered by means of
BRANCH AND SAVE AND SET MODE. It can
also be the return instruction in a program
entered in the 24-bit or 31-bit addressing mode
by means of BRANCH AND SAVE, BRANCH
RELATIVE AND SAVE, or BRANCH RELATIVE
AND SAVE LONG. BRANCH AND SET MODE
with a nonzero R1 field is intended to be used in a
“glue module” to connect either old 24-bit programs
and newer programs that are executed in
the 31-bit addressing mode or old 24-bit or 31-bit
programs and new programs that are executed in
the 64-bit addressing mode. See the programming
notes on pages 5-12 and 5-15 in the section
“Subroutine Linkage without the Linkage
Stack” for a detailed discussion of this and other
linkage instructions.
and page 5-15 says
Quote:
BRANCH AND SAVE AND SET MODE (BASSM) is
intended to be the principal calling instruction to subroutines
outside of an assembler/linkage-editor control
section (CSECT), for use by all new programs
and particularly by programs that must change the addressing mode during the linkage. The calling
sequence has normally been:
where ACON is an A-type address constant, and the
X’80000000’ should be present to give control in the
31-bit addressing mode or should be omitted to give
control in the 24-bit addressing mode.
The return from such a routine normally is:
BSM 0,14
If you're just coding up the Assembler program, why are you needing a "glue module"?
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
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Sr SW Eng-Rocket Software (Assembler,... Kenneth Barton Lasky Mainframe Jobs 0 Fri Aug 25, 2017 12:29 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

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