MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LE Assembler - Call not returning

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Wed Nov 30, 2005 12:53 pm    Post subject: LE Assembler - Call not returning Reply with quote

I am trying to debug a situation where I have an LE compliant Assembler program which issues a LOAD and a BASSM to a second Assembler program (Also LE compliant). The second program is the mainline of a large composite load module consisting of hundreds of assembler and COBOL routines.

Everything seems to go along fine, but for some reason when the called assembler routine terminates, it does not return to the caller.

I have seen this situation occur when in the calling chain, a STOP RUN is issued by a called COBOL program, but I am quite certain this is not occuring.

I am wondering though if this is being caused by the fact that the called routine is also set as being a "MAIN" program in its CEEENTRY macro call. I could change this if need be, but would prefer not to, since this layer that I am adding is not how the CALLED routine is normally invoked.
________
buy iolite vaporizer


Last edited by dtf on Tue Feb 01, 2011 2:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Nov 30, 2005 3:16 pm    Post subject: Reply with quote

dtf,

The following is an C&P from the internet. see if this helps.

On IBM mainframes there was/is a standard linkage convention to be followed that uses a standard 18 fullword save area and certain standard register usage conventions. Register 15 contains the "branch to" address and Register 14 contains the "Return address". So to "call" another program you would do
Code:

L         R15,=V(MYSUBRTN)
BALR R14,R15


Another part of this linkage convention is that the calling program provide within its storage an 18 fullword save area that the subroutine can use to save the callers registers. The standard is that Register 13 will point to this save area at entry to the subroutine. The save areas themselves contain standard offsets where the register contents are saved plus there are forward/backward pointers that chain the save areas together into a linked list stack. Usually the first thing a subroutine does is save the caller's registers and set register 13 to point to it's save area. When an abend occurs a save area trace is produced in the dump and shows the call chain. In assembly language there are SAVE and RETURN macros and the RETURN macros has an option that can be used to set a bit in the save area to indicate to the dump program that a save area is no longer active. When a subroutine ends it restores the callers registers and branches to the return address.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Wed Nov 30, 2005 3:25 pm    Post subject: Reply with quote

DTF,

Check this out, http://publib.boulder.ibm.com/infocenter/cicsts31/index.jsp?topic=/com.ibm.cics.ts.doc/dfhp3/dfhp3b0045.htm

I'm not conversant with LE compliant Assembler, but it sounds as if you are using MAIN=YES, whereas the IBM manual specifically says sub-routines must use MAIN=NO.
Back to top
View user's profile Send private message
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Thu Dec 01, 2005 1:27 pm    Post subject: Reply with quote

Well, as it turns out, this routine actually terminated not by a return to the operating system, but by calling a CEE routine to shutdown LE. I modified this to instead return via R14 and it now works fine.
________
Ford L-Series Trucks history
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group