View previous topic :: View next topic
|
Author |
Message |
michaeltai Warnings : 1 New User
Joined: 23 Jul 2005 Posts: 20
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
michaeltai Warnings : 1 New User
Joined: 23 Jul 2005 Posts: 20
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
|