Expression Evaluation - Panasonic PanaXSeries MN1030 Series User Manual

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 8 Writing Source Statements
8.7.2

Expression Evaluation

There are seven levels of operator precedence. The order of precedence can be changed using
parentheses ( ). Operators with the same precedence are evaluated in order from left to right.
Precedence
Highest
Lowest
An example of operator is shown below.
c1
c2
_CODE
data1
data2
data3
data4
data5
data6
data7
data8
data9
data10
main
An asterisk * is used as both the self-reference address symbol and the multiplication operator, so take
care in its use. The expression *** will be multiplication of the self-reference address symbol by itself.
140 Expressions
Operator
~ + -
Unary negation, unary plus, unary minus
* / %
Multiplication, division, remainder
+ -
Addition, subtraction
<< >>
Left shift, right shift
&
Logical AND
^
Exclusive OR
|
Logical OR
equ
10
equ
0b01101110
section
CODE, PUBLIC, 1
dc
c1/3*(3+4)
dc
c1%3*(3+4)
dc
-c2
dc
~c2
dc
c2>>2
dc
c1<<2
dc
main>>2
dc
c2>>2^0b00001111)>>2
dc
(c2&0b00001111)
dc
c2|0b00001111
org
0x100
mov
c2 & 0b00001111, D0
end
Description

Advertisement

Table of Contents
loading

Table of Contents