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

Assembler Linkage problems


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
michaeltai
Warnings : 1

New User


Joined: 23 Jul 2005
Posts: 20

PostPosted: Mon Jun 22, 2009 1:52 pm
Reply with quote

I have several doubts regarding the Assembler linkage.

1. Almost all of LINK, LOAD, XCTL macros have LIST FORM and EXECUTE FORM. What are they used for? According to the manual, the list form only uses control parameter list. By issuing XCTL EP=XXX,SF=L , how is control paramter list specified and passed?

2. Since we can branch to sub routine by

Code:

         L     R15,=V(SUB)
         BALR  R15,R15


Why do we need to use LINK macro? Does it have something to do with the handling of programs with different AMODE?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Jun 22, 2009 2:19 pm
Reply with quote

LIST form is static whereas EXECUTE form may be dynamic.

Quote:
I2. Since we can branch to sub routine by

Code:

L R15,=V(SUB)
BALR R15,R15



I think you might have some trouble with this and should change to the conventional BALR R14,R15.

The differences between the CALL format (using BALR 14,!5) and LINK are dicumented in the MVS Assembler Services Guide.

Garry.
Back to top
View user's profile Send private message
michaeltai
Warnings : 1

New User


Joined: 23 Jul 2005
Posts: 20

PostPosted: Mon Jun 22, 2009 5:55 pm
Reply with quote

BALR R14,R15 is correct. It's a typo.

I don't understand what do you mean by STATIC and DYNAMIC. The main routine and sub routine are obviously not in one module, so there is no STATIC or DYNAMIC CALL problem.

My second question is not the difference between CALL and BALR, what I asked is since those 2 statements can branch to the sub routine, why there is a need to use LINK macro, is there any other considerations.

I've read those part of the assembler services guide many times. So please don't ask me to read any more. I will never post before I read the manual.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jun 22, 2009 6:06 pm
Reply with quote

Nobody mentioned static or dynamic calls -- there's more than one meaning to those words. Static in Garry's context means fixed at compile time, while dynamic means some of the parameter values may be specified when the program is running.

MVS Assembler Services Guide in chapter 4.6.2.1 Using the Link or Linkx Macro discusses the similarities and differences between using the CALL and LINK to pass control to another program.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Jun 22, 2009 6:45 pm
Reply with quote

Quote:
I don't understand what do you mean by STATIC and DYNAMIC. The main routine and sub routine are obviously not in one module, so there is no STATIC or DYNAMIC CALL problem.


I wasn't referring to static and dynamic CALL. The MACRO can be coded in-stream as a a hard-coded (static) LINK or may by used by coding the execute form of the macro which refers to parameters defined in the list form elsewhere in the program. By this means, the executed form may address different list forms dynamically. This applies to any such macros.
Quote:
My second question is not the difference between CALL and BALR,
I didn't suggest that it was. The parentheses were just indicating that the CALL results in a BALR.

Among other things, using the LINK macro ensures that you always get a fresh copy of the load module. A CALL will re-use an already loaded copy.

Garry.
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts C++ problems Java & MQSeries 3
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts MFT File transfer problems All Other Mainframe Topics 5
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top