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

Assembler calling cobol


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jan 13, 2010 4:59 pm
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 13, 2010 7:20 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top