HP 3000 Manuals

HPSWTONM PLABEL Intrinsic [ Switch Programming User's Guide ] MPE/iX 5.0 Documentation


Switch Programming User's Guide

HPSWTONM PLABEL Intrinsic 

The HPSWTONMPLABEL intrinsic allows CM user programs, user libraries, and
system code to invoke NM procedures.  In a manner similar to the
HPSWITCHTOCM intrinsic, HPSWTONMPLABEL does the following:

 *  Converts the CM references in the argument list to virtual NM
    addresses

 *  Changes the execution mode

 *  Invokes the NM procedure specified by the CM caller

Since NM code can address the entire CM stack, there is no copying of
reference parameters.  The length of each actual parameter is not needed
because lengths are implied in the descriptor list.

The syntax of this intrinsic and detailed explanations of its parameters
are given in the following paragraphs.  Also provided are examples of
switches in the CM--> NM direction.

Syntax 

Prior to calling the HPSWTONMPLABEL intrinsic, your programming language
may require you to declare it.  In Pascal/V, the declaration is as
follows:

          FUNCTION HPSWTONMPLABEL : INTEGER; INTRINSIC;

Next, an example Pascal/V call to this intrinsic:

          return_status := HPSWTONMPLABEL (proc, nparms, arglist,
                                      argdesc, functype);

You call the HPSWTONMPLABEL intrinsic with five parameters.  These
parameters provide Switch with the following information:

 *  Plabel of the NM routine (as returned by the HPLOADNMPROC intrinsic)

 *  Number of parameters in the NM routine

 *  Parameter list

 *  Parameter description list

 *  Type of the functional return value (if any)

All this information is key to the correct operation of mixed-mode
procedure calls.

Parameters 

A detailed explanation of the parameters of the HPSWTONMPLABEL intrinsic
follows.

Required parameters are shown in boldface; optional parameters are shown
in italics.

proc             double by value (required) 

                 Passes the NM plabel of the target procedure name.  This
                 plabel is usually obtained by calling the HPLOADNMPROC
                 intrinsic.

nparms           16-bit signed integer by value (required) 

                 Passes the number of parameters you are passing to the
                 target NM procedure.  It specifies the length of the
                 argdesc\array.  You must also account for any hidden
                 parameters due to ANYVAR parameters, an extensible
                 parameter list, and so forth.  For more information on
                 hidden parameters, refer to the HP Pascal/XL Reference
                 Manual (31502-90002).

arglist          16-bit signed integer array by reference (required) 

                 Passes the actual parameters you are going to pass to
                 the NM procedure.

argdesc          16-bit signed integer array by reference (required) 

                 Passes integer codes describing the parameters held in
                 the arglist array, that is, byte, word, double, pointer,
                 and so forth.

functype         16-bit signed integer by value (required) 

                 Passes the data type of the value the target procedure
                 returns if it is a function.  If the target is not a
                 function, the value of this parameter is zero.  The
                 supported function types are described in Figure 4.3.

For more information on the arglist and argdesc arrays, see the
discussion of HPSWTONMNAME parameters.


MPE/iX 5.0 Documentation