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
 

 

Static and Dynamic call in Assembler

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
alokagarwaljgd

New User


Joined: 02 Jun 2006
Posts: 28

PostPosted: Tue May 18, 2010 2:39 pm    Post subject: Static and Dynamic call in Assembler
Reply with quote

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
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue May 18, 2010 7:01 pm    Post subject:
Reply with quote

You got to LOAD before you BALR if it's dynamic......
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue May 18, 2010 7:07 pm    Post subject: Reply to: Static and Dynamic call in Assembler
Reply with quote

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
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 Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am


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