This information describes the mechanics of correct linkage in
31-bit addressing mode. Keep in mind that there are considerations
other than linkage, such as locations of areas that both the calling
module and the invoked module need to address.
As shown in
Figure 1, it is the linkage
between modules whose addressing modes are different that is an area
of concern. The areas of concern that appear in
Figure 1 fall into two basic categories:
- Addresses passed as parameters from one routine to another must
be addresses that both routines can use.
- High-order bytes of addresses must contain zeroes or data that
the receiving routine is programmed to expect.
- Addresses must be less than 16 megabytes if they could be passed
to a 24-bit addressing mode program.
- On transfers of control between programs with different AMODEs,
the receiving routine must get control in the AMODE it needs and return
control to the calling routine in the AMODE the calling routine needs.
There are a number of ways of dealing with the areas of concern
that appear in
Figure 1:
- Use the branching instructions (BASSM and BSM)
- Use pointer-defined linkage
- Use supervisor-assisted linkage (ATTACH, ATTACHX, LINK, LINKX,
XCTL, and XCTLX)
- Use linkage assist routines
- Use “capping.”
Figure 1. Linkage Between Modules with
Different AMODEs and RMODEs