Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Assembler Linkage problems

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Assembler Linkage problems
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jun 22, 2009 2:19 pm    Post subject:
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    Post subject: Reply to: Assembler Linkage problems
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: 7936
Location: Bellevue, IA

PostPosted: Mon Jun 22, 2009 6:06 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jun 22, 2009 6:45 pm    Post subject:
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    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
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm
This topic is locked: you cannot edit posts or make replies. MVS Assembler profiles for Pune Locat... shailesh_do Mainframe Jobs 0 Mon Feb 22, 2016 6:21 pm
No new posts Problems in File-Aid / DB2 Spufi whil... amitc23 CLIST & REXX 6 Fri Feb 12, 2016 1:59 pm
No new posts Number of parameters in Linkage kregen COBOL Programming 4 Wed Jan 27, 2016 5:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us