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

Static linking and Dynamic linking in Assembler


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

New User


Joined: 04 Apr 2007
Posts: 17
Location: Chennai

PostPosted: Thu Mar 13, 2008 9:02 pm
Reply with quote

We know that in COBOL we use
call "program-1" to statically link program-1 to main program

and
move "program-1" to myprog
call myprog to dynamicall link program-1 to main program.

How can we achive this (Static link and Dynamic linking) in Assembler.

Thanks
Ganesh
Back to top
View user's profile Send private message
Mistermind

New User


Joined: 08 Feb 2008
Posts: 46
Location: Dublin

PostPosted: Sun Mar 16, 2008 1:30 am
Reply with quote

Ordinary linkedit will pick up assembler subroutines invoked by IBM "CALL" macro.

To invoke a dynamic subroutine, invoke IBM macro LOAD (check out the parameters), then simply branch to the first byte of the loaded subroutine loadmodule. Upon completion the subroutine will return control to the calling module.
Back to top
View user's profile Send private message
Mistermind

New User


Joined: 08 Feb 2008
Posts: 46
Location: Dublin

PostPosted: Sun Mar 16, 2008 1:32 am
Reply with quote

You will need to GETMAIN to ensure storage is available for you dynamic subroutine. You can load your subrtn below or above the line. The LOAD will be executed once only, before the first execution of the subrtn.
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 Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top