HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

HPSWITCHTOCM

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM callable only.

Makes native mode (NM) to compatibility mode (CM) mixed-mode procedure calls possible.

Syntax

                REC  I32V    I32V     RECA

   HPSWITCHTOCM(proc,method,numparms,parms,

                I32V  RECV  I16    I32

                fretlen,fretval,condcode,status);

Parameters

proc

record (required)

Passes the target CM procedure identifier, which you can specify either by a library to search and an ASCII name of up to 16 characters or by a CM plabel (obtained from the HPLOADCMPROCEDURE or LOADPROC intrinsic).

The structure of the proc record varies, depending on how the target procedure is identified. All variants have a p_proc_id_type field.

method

32-bit signed integer by value (required)

Passes a value indicating whether the CM target procedure runs in normal, split-stack, or no-copy mode. Valid values are:

ValueMeaning
0Normal (non-split-stack)
1Split-stack
2No-copy

NOTE: If all parameters are within the CM stack or the length of the reference parameters are less than the threshold, use the normal value. If the reference parameters are outside of the CM stack (split-stack), wrap the reference parameters in an extra data segment if the reference parameters are outside of the CM stack (split-stack method). The no-copy method is the same as the split-stack method, except that the threshold check is omitted.
numparms

32-bit signed integer by value (required)

The number of parameters you are passing to the CM target procedure.

parms

array of records (required)

Passes descriptions of each parameter being passed to the CM target procedure. Each parameter is located and described by a record in this array.

fretlen

32-bit signed integer by value (optional)

The length in bytes of the optional functional return value.

fretval

record by value (optional)

NM pointer to the beginning of the area to which the optional functional return value is returned.

condcode

16-bit signed integer by reference (optional)

Returns the condition code that the target CM procedure returns. Valid values are in the range 0..2.

NOTE: If a call to HPSWITCHTOCM fails, the value of the condcode parameter becomes undefined. Before attempting to use the condcode, first check the value of the status parameter.
status

32-bit signed integer by reference (optional)

Returns the status of the HPSWITCHTOCM intrinsic call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpreted as two 16-bit fields.

Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Refer to the MPE/iX Error Message Manual Volumes 1, 2 and 3 (32650-90066, 32650-90152, and 32650-90368) for a description of its value.

Bits (16:16) comprise status.subsys. The value represented by these bits defines the subsystem that set the status information. The subsystem identifier for HPSWITCHTOCM is 100.

Operation Notes

There are differences in data and variable representations between NM and CM. Programs that switch from NM to CM must use the HPSWITCHTOCM intrinsic which provides mixed-mode execution access and performs the necessary parameter translation between the two modes of execution.

Related Information

Intrinsics

None

Commands

None

Manuals

Switch Programming Guide (32650-90014)

Feedback to webmaster