Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
50 Chapter2
Controlling Asynchronous Devices Programmatically
MPE/iX System Intrinsics
Other Types of Intrinsics
The discussion in this manual pertains exclusively to system intrinsics.
Certain application programs and system utilities also provide
subroutines that are referred to as intrinsics. For example,
VPLUS/3000 iX provides a set of intrinsics for handling page block
mode programming. For a description of VPLUS/3000 iX intrinsics see
the VPLUS Reference Manual. For descriptions of intrinsics provided
by any other application or utility, see the documentation for that
program.
Using Intrinsics in your Program
You can call any system intrinsic from any supported language, but the
details of the calling procedure vary according to the language being
used. In general, you should follow the steps as summarized:
1. Refer to the intrinsic description in Chapter 8, “Intrinsics
Reference,” to determine the parameter types and their positions in
the parameter list.
2. Declare variables to be passed as parameters, using types
appropriate to the language you are using to write your program.
3. Include the name of the intrinsic in a declaration statement, if
appropriate for your programming language.
4. Issue the intrinsic call at the appropriate place in your program.
Depending on the intrinsic call, error checking is provided either
through condition codes or through a special status parameter. Because
the condition code or status return value can provide you with useful
information about what happened during execution of an intrinsic, you
should routinely check for error conditions at the completion of each
intrinsic call.
Condition Codes
Most of the intrinsics discussed in this manual use condition codes for
error checking. Condition codes are status flags stored in two bits of the
status register. Their values and general meanings are shown in Table
2-1. Because the condition code status flags are affected by almost every
instruction, you should check condition codes immediately after
execution of an intrinsic to make sure that the information being
returned pertains to the intrinsic and not to some subsequent activity.
The method of accessing condition codes is language specific. Pascal/iX,
for example, provides the function ccode, which returns the value 0, 1,
or 2, depending on the current condition code stored in the status
register. See the reference manual for the language you are using to
determine how to access condition code information.