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
 

 

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: 10274
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: 8117
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
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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