Hyper Call Stack Frame

This is the stack frame format used for the Branch Communicate (BCT) and Hypercall (HCL) instructions. No parameters are passed by the BCT instruction.

The BCT and HCL instructions are typically used to communicate with the MCP, and always involve an environment change to the new addressing and privilege environment.

By convention BCT instructions have parameters embedded in the code stream following the actual BCT opcode. In MCP/VS, BCT opcodes call into thunk procedures in the MCP. The thunk will move the parameters from the calling codestream into the stack in the same place an HCL instruction would have placed them.

Information Digits
New TOS (HCL) =⇒
Stack Parameters (0 to 9999 bytes) 96+
New TOS (BCT) =⇒
Stack Frame Indicator (FE) 94 - 95
Saved IX3 Value 86 - 93
New IX3 =⇒ Next Instruction Address 80 - 85
Active Environment Number 74 - 79
COM and OVF flags 72 - 73
Task Enable Toggles 70 - 71
Mobile Index Registers (IX4..IX7) 38 - 69
Interrupt Mask 36 - 37
Measurement Register 28 - 35
Accumulator 00 - 27
Old TOS =⇒ 00

Stack frames on V Series build upwards, that is, to increasing addresses. At the completion of routine entry, Index Register 3 (IX3) will point to the base of the stack frame, and the Top Of Stack (TOS) register will point to the next place a stack frame can be allocated. The stack can continue to build upward until the limit of Memory Area (MA) 0 is reached.

IX3 may have any value before the BCT/HCL instruction. The previous value is saved in the stack frame and will be restored from the stack contents on return. TOS must be valid before the call, since it will determine the location where the stack frame is stored. Stack frame addresses must always be even. An odd TOS value on procedure entry will result in a processor fault.

Transitioning to a new addressing environment may (and usually does) result in a change of MA 0 addressing. Both TOS and IX3 (and the new stack frame itself) are located in MA 0. The environment is switched so that the new MA 0 data values and stack will be used to store the stack frame. The old environment number is remembered and placed in the stack frame.

Return from a BCT or HCL will use IX3 to locate the current stack frame. The frame indicateor is validated, and then the restorable information from the 'Saved IX3' downward is loaded into the machine registers, and TOS and IX3 in MA 0 are restored. Finally the old addressing environment is restored.

stack_frames/hypercall_stack_frame.txt · Last modified: 2009/05/07 19:43 by lwilton
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