IBM OS/390 User Manual

Page of 673
contained in register 13. Therefore, you must specify a save area to receive the
registers.
PROGA START
PROGB CSECT
PROGC CSECT
(MVS) (MVS) (MVS)
. . .
. . .
STM 14,12,12(13)
STM 14,12,12(13)
STM 14,12,12(13)
ST
13,SAVEA+4
ST
13,SAVEB+4
ST
13,SAVEC+4
LA
11,SAVEA
LA
11,SAVEB
LA
11,SAVEC
ST
11,8(13)
ST
11,8(13)
ST
11,8(13)
LR
13,11
LR
13,11
LR
13,11
. . .
. . .
Application Application Application
Program Program Program
Logic Logic Logic
. . .
. . .
CALL PROGB
CALL PROGC
L
13,4(,13)
L
13,4(,13)
L
13,4(,13)
Return (MVS)
Return (PROGA)
Return (PROGB)
SAVEA DC
18F
′ 0 ′
SAVEB DC
18F
′ 0 ′
SAVEC DC
18F
′ 0 ′
. . .
END END END
Figure 28. MVS Subroutine Linkage
If a standard save area of 18 fullwords is reserved in the calling program, the
save area contains the following information at completion of the called
program
s initialization logic.
Consider three programs using the concept of forward and backward chains with
standard linkage conventions. Under VSE, these could be three application
programs, while under MVS, the highest-level program that must be considered
is the MVS control program because it calls the MVS highest-level application
program.
Linkage Macros
CALL, SAVE, and RETURN macros are available under VSE and MVS. This set of
macros performs the general housekeeping required to maintain subroutine
conventions within the CSECTs of a simple program structure. In general, these
MVS macros provide additional functions not available in VSE. You can use the
VSE versions of these macros under MVS without any modification.
Word 1
Used by LE-compliant languages
Word 2
Address of the caller
s save area (the backward chain).
Word 3
Address of the save area of the called program (the forward chain).
Word 4
Register 14. Return address within the calling module.
Word 5
Register 15. Entry point address of called module.
Words 6-18
Registers 0 through 12, respectively, of the calling program.
Chapter 13. A s s e m b l e r
271