HP 3000 Manuals

Overview [ Switch Programming User's Guide ] MPE/iX 5.0 Documentation


Switch Programming User's Guide

Overview 

This overview presents mixed-mode procedure calls in the NM--> CM
direction in two ways:

 *  Schematic flow-of-control diagram

 *  Stepwise sequence of events

Flow of Control:  NM--> CM 

The flow of control for mixed-mode procedure calls in the direction NM-->
CM is illustrated in Figure 3.1:

[]
Figure 3.1. NM--> CM Switch Summary 1 Stepwise Switch to CM A mixed-mode procedure call in the direction NM--> CM involves the following steps, as indicated in Figure 3.1: 1. The NM code needing to access a CM routine calls Switch, either by means of in-line code or a Switch stub. 2. The in-line code or NM Switch stub sets up the data structures and parameters required by Switch and makes a call to the HPSWITCHTOCM intrinsic (call by name), or the HPLOADCMPROCEDURE and HPSWITCHTOCM intrinsics (call by plabel). 3. HPSWITCHTOCM calls the CM routine and passes the parameters, translating addresses and/or copying data to Compatibility Mode as required by their type, size, and location. 4. The CM routine executes using the passed parameters and returns its data values to HPSWITCHTOCM. 5. HPSWITCHTOCM receives the data values returned by the CM routine, back-translating addresses and recopying data as needed. 6. HPSWITCHTOCM returns the translated values to the caller. The stub or in-line code checks whether the Switch operation was successful and then control returns to the NM routine.
NOTE HPSWITCHTOCM is the system intrinsic that makes NM parameters addressable to Compatibility Mode, changes the execution mode, and invokes the CM routine. HPSWITCHTOCM and HPLOADCMPROCEDURE reside in the NM system library, NL.PUB.SYS.


MPE/iX 5.0 Documentation