alokagarwaljgd
New User
Joined: 02 Jun 2006 Posts: 28
|
|
|
|
Hi,
1) Can anybody please tell me what are static and dynamic calls in Assembler and how to achieve them?
2) How can we distinguish whether a call is static/dynamic in Assembler just by seeing the code?
Any help provided for the above questions is really appreciated.
Thanks,
Alok Agarwal |
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
A Static Call, utilizes a VCON, which contains the address of the target sub-program, resolved at Link Edit time. In other words, the sub-program and the calling load module are merged as one. A BASR R14,R15 is used to call the static sub-program.
Code: |
L R15,=V(SUBPROG)
BASR R14,R15
|
A Dynamic Call, utilizes an ADCON or simply loading the external sub-program into memory, via the MVS LOAD Macro, then using the load-point address (returned in R0) in a subsequent BASR.
Code: |
LOAD EP=SUBPROG
LR R15,R0
BASR R14,R15
|
In both examples, once control is returned from the sub-program, R14 will contain the address of the "NSI" (Next Sequential Instruction) and R15 should contain a return-code value, set by the sub-program. The building of the R1 parmlist has been omitted as this should be an exercise for the poster.
In addition (amongst others), there's also the CALL and LINK Macro as well as the EXTRN directive.
Although BALR is still used quite extensively, BASR should be used going forward.
Bill |
|