z/OS MVS Programming: Extended Addressability Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Extract stacked registers (EREG) instruction

z/OS MVS Programming: Extended Addressability Guide
SA23-1394-00

Use the extract stacked registers (EREG) instruction to load ARs and GPRs from the current linkage stack entry. A typical use of EREG is in the middle of a subroutine after the caller's input registers have been modified for other purposes. Use EREG to restore the contents of the AR/GPR pairs.

In the following example, EREG extracts the contents of the calling program's ARs 0-1 and GPRs 0-1 from the current entry and loads them into ARs 0-1 and GPRs 0-1. The entry in this example was caused by the BAKR instruction.

Table 1. Example of an EREG instruction.

The table shows how EREG extracts contents from the calling program and loads them.

CALLING PROGRAM SUBROUTINE
.
L    15,=A(SUBR)
BALR 14,15
.
.
.
.
SUBR EQU  *
     BAKR 14,0
     .
     .
     .
     EREG 0,1
     .
     .
     PR

The EREG instruction does not change the current stack pointer.

Another example of using EREG to extract the contents of an AR/GPR pair appears in Example of using TESTART.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014