View previous topic :: View next topic
|
Author |
Message |
Avinashhlg
New User
Joined: 05 Jan 2010 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|