HP C/iX Reference Manual (31506-90011)
Chapter 10 179
Using Intrinsics
Condition Codes
Condition Codes
Condition codes are temporary values that provide basic information about the execution
of intrinsics. Many of the MPE/iX intrinsics alter the condition code upon their completion.
You can review condition code values to determine the success of an intrinsic call. To
recover the condition code, call the HP C/iX library routine, ccode, immediately upon
returning from an intrinsic. This ensures that no other instruction alters the condition
code. You should only use the ccode routine in simple if statements or assignment
statements because of the possible side effects of the order of expression evaluation.
The following macros in the MPE.H header file define condition code values:
The specific meaning of the condition code depends on which intrinsic function is called.
Refer to the description of each intrinsic in the MPE/iX Intrinsics Reference Manual for
the exact meaning of the condition code.
Example
The following code segment illustrates typical condition code checking.
SOME_INTRINSIC_FUNC(arg1, arg2);
if (ccode() != CCE)
error_handler(); /* Intrinsic call failed; */
/* set up error handler */
Table 10-1. Condition Code Values
Macro Value Meaning
CCG Condition code greater A special condition occurred but may not have affected the
execution of the request.
CCL Condition code less The request was not granted, butthe error condition may be
recoverable.
CCE Condition code equal This generally indicates that the request was granted.