Condition Codes [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation
HP C/iX Reference Manual
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:
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, but the error |
| | | condition may be recoverable. |
| | | |
----------------------------------------------------------------------------------------------
| | | |
| CCE | Condition code equal | This generally indicates that the request was |
| | | granted. |
| | | |
----------------------------------------------------------------------------------------------
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 */
MPE/iX 5.0 Documentation