Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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

Senior Member


Joined: 14 Mar 2007
Posts: 10478
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: 8339
Location: Dubuque, Iowa, 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. Issue in suppressing leading zeros &a... Vijay_Sirisha COBOL Programming 21 Thu Jun 07, 2018 8:01 pm
No new posts VBS to VB in COBOL and JCL srajendran2 COBOL Programming 12 Fri Jun 01, 2018 3:04 am
No new posts mapping PLI structure to assembler co... Pedro PL/I & Assembler 3 Fri Jun 01, 2018 2:53 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts How to convert 2 bytes into single by... pkmurali DB2 6 Fri May 25, 2018 1:41 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us