Joined: 14 Jan 2008 Posts: 2504 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.
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.
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.