8.7.3
Expression Syntax
Below is an expression syntax diagram
(
expression
NOTE:
mov
(10+5), d0
mov
(0+(10+5), d0
mov
(10+5)+2, d0
expression
binary operator
unary operator
symbol
constant
Expression Syntax
When the expressions starting with parenthesis are coded to the operands of
Machine language instructions, it will be regarded as an address-reference. To
be proceeded as expressions, put 0+ before the parenthesis and distinguish
them from others.
; move the value of address 15 to d0
; equal to mov(15), d0
; move the value of constant 15 to d0 equal to mov 15, d0
; Error. "(10+5)" is regarded as an address-reference.
; It causes syntax error.
)
*
Chapter 8 Writing Source Statements
expression
Expressions 141