Transfer Control (XCTL)


Op Code (Hex) Operand 1 Operand 2

0282 Program to be called or call template Argument list

Operand 1: System pointer or space pointer data object.

Operand 2: Operand list or null.

Description

The instruction destroys the calling invocation and passes control to either the program entry procedure of a bound program or the external entry point of a non-bound program. If operand 1 specifies a Java™ program or a bound service program, an invalid operation for program  (hex 2C15) exception is signaled.

Operand 1 may be specified as a system pointer which directly addresses the program that is to receive control or as a space pointer to a call template which identifies the program to receive control. Specifying a template allows for additional controls over how the specified program is to be invoked. The format of the call template is the following:


Offset
Dec Hex
Field Name
Data Type and Length
0 0
Call options
Char(4)
0 0
Suppress adopted user profiles
Bit 0



0 = No
1 = Yes


0 0
Reserved (binary 0)
Bits 1-30
0 0
Force thread state to user state for transfer
Bit 31



0 = No
1 = Yes


4 4
Reserved (binary 0)
Char(12)
16 10
Program to be called
System pointer
32 20
--- End ---

The suppress adopted user profiles option specifies whether or not the program adopted and propagated user profiles which may be serving as sources of authority to the thread are to be suppressed from supplying authority to the new invocation. Specifying yes causes the propagation of adopted user profiles to be stopped as of the calling invocation, thereby, not allowing the called invocation to benefit from their authority. Specifying no allows the normal propagation of adopted and propagated user profiles to occur. The called program may adopt its owning user profile, if necessary, to supplement the authority available to its invocation.

The force thread state to user state for transfer option specifies whether or not the transfer control needs to be done in the current thread state or change the thread state to user state.

Operand 2 specifies an operand list that identifies the arguments to be passed to the invocation to which control is being transferred. Automatic objects allocated by the transferring invocation are destroyed as a result of the transfer operation and, therefore, cannot be passed as arguments. An argument list length violation  (hex 0802) exception is signaled if the number of arguments passed does not correspond to the number required by the parameter list of the target program.

If the transferring invocation has an activation, the invocation count is decremented by 1.

If the transferring invocation has received control to process an exception, or an invocation exit, the return instruction invalid  (hex 2C01) exception is signaled.

If the transferring invocation currently has an invocation exit set, the invocation exit is not given control and is implicitly cleared.

Common Program Call Processing

The details of processing differ for non-bound and bound programs. The following outlines the common steps.

  1. A check is made to determine if the caller has authority to invoke the program and that the object is indeed a program object. The specified program must be either a bound program that contains a program entry procedure or a non-bound program.

  2. The activation group in which the program is to be run is located or created if it doesn't exist.

  3. If the program requires an activation entry and it is not already active within the appropriate activation group, it is activated. Bound programs always require an activation; non-bound programs require an activation only if they use static storage. The invocation count of a newly created activation is set to 1 while the invocation count of an existing activation is incremented by 1.

  4. The invocation created for the target program has the following attributes (as would be reported via the Materialize Invocation Attributes (MATINVAT) instruction.)

  5. The automatic storage frame (ASF), if required, is allocated on a 16-byte boundary.

  6. Control is transferred to the program entry procedure (or external entry point) of the program.

  7. Normal flow-of-control resumes at the instruction following the caller of the program issuing the XCTL instruction.

The details of locating the target activation group and activating the program differ depending upon the model of the program.

Bound Program

A bound program is activated and run in an activation group specified by program attributes. There are two logical steps involved:

After locating the activation entry for the program, control is passed to the program entry procedure for the program. If required, the activation group is destroyed when the invocation for the program entry procedure is destroyed.

Non-bound Program

The automatic storage frame begins with a 64 byte header. If the program defines no automatic data items the frame consists solely of the 64-byte header, otherwise the automatic storage items are located immediately following the header. In prior releases of the machine, this header contained invocation information which is now available via the Materialize Invocation Attributes (MATINVAT) instruction. This header is not initialized and the contents of the header are not used by the machine. (The space is allocated merely to provide for compatibility with prior implementations of the machine.) The update PASA stack program attribute, supported in prior implementations of the machine, is no longer meaningful and is ignored, if specified as an attribute of the program.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0A Authorization

10 Damage Encountered

1A Lock State

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2A Program Creation

2C Program Execution

2E Resource Control Limit

36 Space Management

38 Template Specification

44 Protection Violation