The SYNCH macro allows a program to take a synchronous exit to a processing program. After the processing program has finished, the program that issued the SYNCH macro regains control. The SYNCH macro is intended for use by primary mode programs only. If your program is in access register (AR) mode, use SYNCHX, which provides the same function as SYNCH.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state and any PSW key. |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN=HASN=SASN |
AMODE: | 24- or 31-bit for SYNCH; 24- or 31- or 64-bit for SYNCHX. |
ASC mode: | Primary |
Interrupt Status: | Enabled for I/O and external interrupts |
Locks: | No locks held |
Control parameters: | Must be in the primary address space. |
None.
None.
Before issuing the SYNCH(X) macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.
None.
The standard form of the SYNCH macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede SYNCH. |
SYNCH | |
␢ | One or more blanks must follow SYNCH. |
entry point addr | entry point addr: RX-type address, or register (2) - (12) or (15). |
,RESTORE=NO | Default: RESTORE=NO |
,RESTORE=YES | |
,AMODE=24 | Default: AMODE=CALLER. |
,AMODE=31 | Note: AMODE=DEFINED can be specified only |
,AMODE=DEFINED | if the entry point address is provided in |
,AMODE=CALLER | a register. |
The parameters are explained as follows:
If AMODE=24 is specified, the requested program will receive control in 24-bit addressing mode.
If AMODE=31 is specified, the requested program will receive control in 31-bit addressing mode.
If AMODE=DEFINED is specified, the user must provide the entry point using a register and not an RX-type address. The requested program will receive control in the addressing mode indicated by the high order bit of the entry point address. If the bit is set to 0, the requested program will receive control in 24-bit addressing mode; if the bit is set to 1, the requested program will receive control in 31-bit addressing mode.
If AMODE=CALLER is specified, the requested program will receive control in the addressing mode of the caller.
None.
LOAD EP=PROGRAMA,DCB=LIB1 Load desired program
LR R8,R0 Obtain the entry point
SYNCH (R8),RESTORE=NO
SYNCH SUBRTN,RESTORE=YES
SYNCH (8),RESTORE=YES,AMODE=24
SYNCH (8),RESTORE=YES,AMODE=DEFINED
SYNCH (8),RESTORE=YES,AMODE=CALLER