Branch Communicate (BCT)/OP=30

Format

OP AFBF

OP = 30

AFBF is a Function Address consisting of the low order four digits of an address that is relative to the specified Task's MCP Data Area. The high order digits are equal to zero. Indirect field lengths may be specified.

Function

The Branch Communicate instruction is used to allow a user program to enter a function in the MCP environment. It stores processor state and registers in Hyper Call Stack Frame format on the stack of the called environment and passes control to the specified function.

Its function is similar to the function of the Hyper Call instruction except for the selection of the function entry and the inability to directly pass parameters.

The use of the Mobile Index Registers or the Accumulator to pass parameters is invalid. The contents are not guaranteed.

The following operations are performed by this instruction:

1. Locate Function Entry

The four digit function address (AFBF) is used as an offset relative to the MCP Data Area for the current task to select a Function entry.

If the protection field of the Function Entry is not equal to “DD”, cause an Invalid Instruction fault (**IEX = 37**) and terminate the instruction with no furher action.

2. Locate and Resolve Function Environment

Resolve the Environment Number, contained in the Function Entry, to point to the selected Environment Table Entry. However, retain the Active Environment Number so that it may be stored on the stack.

Resolve entry #0 of the Memory Area Table for the new environment from memory and maintain addressability along with base #0 of the current environment.

3. Create Hyper Call Stack Frame

The top of stack pointer, located at address 40 (relative to the new environment's base #0), is used as the starting address, relative to the new environment's base #0, to store the Hyper Call Stack Frame.

The sum of the stack pointer and the size of the hyper call frame (96 digits) and the size of the hardware call stack frame area (500 digits) is compared to Limit #0. If the sum is equal to or greater than Limit #0, cause a Stack Overflow fault and terminate the instruction with no further action. Otherwise store the Hyper Call Stack Frame.

See Compatibility Notes A.56 for the accumulator format.

4. Update Top Of Stack pointer

Store the new address of the next available stack location (relative to the new environment's Base #0), into memory location 40 (relative to the new environment's base #0).

5. Set new IX3 value

Set the two most significant digits of IX3 to C0 and set the six least significant digits of IX3 to the initial address specified in memory location 40 (relative to the new environment's base #0) plus 80.

IX3 will now point to the Next Instruction Address in the Hyper Call Stack Frame.

6. Update Processor State

Set the machine state as follows:

Information Set To
Next Instruction Address Function Entry
Active Environment Number Function Entry
Interrupt Mask Function Entry
Task Enable Toggles Function Entry
Comparison & Overflow Flags Reset
Measurement Register User Field 000000

7. Update Measurement Register

Set the Name field of the Measurement Register (most significant two digits of register) as follows:

BIT State
7 Set
6 Set if Privileged Enable set (from task enable toggles of function entry)
5 - 0 Unchanged

8. MOPOK line

Set the MOPOK line to “zero” while the Measurement register is being changed and set it to a “one” at all other times.

9. Check for Soft Fault

If Soft Fault is now enabled, examine the soft fault pending field specified by the Reinstate List Entry pointer plus 8. If it is not equal to zero, execute a Hardware Call Procedure that will store the address of the next instruction to be executed.

10. Load the processor Base and Limit registers

Perform the Load Memory Area Table procedure passing the active environment number in the function table as parameter and setting the type of MA fault parameter to Soft.

11. Branch to BCT function

Using the new Base/Limit information, resolve the next instruction address, relative to base #1, and execute an unconditional branch to that address.

Comparison Flags

The Comparison Flags and Overflow Flag are set to NULL and No Overflow for the called function.

instructions/bct.txt · Last modified: 2008/12/17 16:07 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki