HP 3000 Manuals

HP C Language Operators [ Symbolic Debugger/iX User's Guide ] MPE/iX 5.0 Documentation


Symbolic Debugger/iX User's Guide

HP C Language Operators 

The following table lists the supported HP C operators.  Operators are
listed in order of precedence, from highest to lowest.  All operators
listed in the same box are of equal precedence.  Associativity of
operators in the following table is from left to right, unless otherwise
stated.

For HP C, the operators && and || are not short circuited as is done by
the HP C compiler; all portions of an expression involving these
operators are evaluated.  Also, HP C pointer arithmetic in the debugger
is unsupported.

Full support of struct objects is provided.

HP C Language Operators 

          Table B-1.  Language Operators for HP C 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                  Operator                   |                  Operation                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| ( )                                         | parenthesis (group elements)                |
|                                             |                                             |
| [ ]                                         | array member selection                      |
|                                             |                                             |
| ->                                          | member selection of pointer to structure    |
|                                             |                                             |
| .                                           | member selection of structure               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| !  (order is right to left)                 | unary logical negation                      |
|                                             |                                             |
| ~ (order is right to left)                  | unary logical one's complement              |
|                                             |                                             |
| - (order is right to left)                  | unary negation                              |
|                                             |                                             |
| * (order is right to left)                  | unary indirection (pointer or address       |
|                                             | dereferencing)                              |
|                                             |                                             |
| & (order is right to left)                  | unary address of an object                  |
|                                             |                                             |
| sizeof (order is right to left)             | unary size of an object                     |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| *                                           | multiplication                              |
|                                             |                                             |
| /                                           | division                                    |
|                                             |                                             |
| %                                           | modulus - mod function                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| +                                           | addition                                    |
|                                             |                                             |
| -                                           | subtraction                                 |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| <<                                          | bit-wise logical left shift; fill with 0    |
|                                             |                                             |
| >>                                          | bit-wise arithmetic right shift; unsigned   |
|                                             | fill with 0, else fill with sign bit        |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| <                                           | relational less than                        |
|                                             |                                             |
| <=                                          | relational less than or equal to            |
|                                             |                                             |
| >                                           | relational greater than                     |
|                                             |                                             |
| >=                                          | relational greater than or equal to         |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| ==                                          | relational equal to                         |
|                                             |                                             |
| !=                                          | relational not equal to                     |
|                                             |                                             |
---------------------------------------------------------------------------------------------

          Table B-1.  Language Operators for HP C (cont.) 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                  Operator                   |                  Operation                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| &                                           | bit-wise logical and                        |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| ^                                           | bit-wise logical exclusive or               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| |                                           | bit-wise logical inclusive or               |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| &&                                          | logical and                                 |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| ||                                          | logical or                                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| =(order is right to left)                   | assignment                                  |
|                                             |                                             |
| op=(order is right to left)                 | assignment operators of the form:  e1 op=   |
|                                             | e2 which means (e1) = (e1) op (e2).  Op may |
|                                             | be any one of the mathematical or bit-wise  |
|                                             | operators (*, /, %, +, <<, >>, &, ^, |)     |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Special operators:                          |                                             |
|                                             |                                             |
| $addr                                       | unary address of an object                  |
|                                             |                                             |
| $sizeof                                     | unary size of an object                     |
|                                             |                                             |
| $in                                         | unary suspended in named routine            |
|                                             |                                             |
---------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation