Chapter 8 Writing Source Statements

8.7Expressions

Expressions are symbols, self-reference address symbols, and constants linked by operators, with the result representing a single value. When an expression is coded as an operand, its result will be a number or an address depending on the type of instruction.

When a symbol or self-reference address included in an expression is a forward referenced symbol, a relocatable symbol, or an undefined symbol, the result of the expression cannot be resolved by the assembler. It will then be resolved by the linker.

NOTE:

If a section name in the expression was used as a symbol, declaration with the

 

 

section directive must be done in the file. Without doing this would lead an error

 

 

in the assembler or linker.

 

 

Example:

section CODE,PUBLIC,1

 

 

sec

 

 

_TEXT

section CODE,PUBLIC,1

 

 

 

mov

sec, A0

Expressions 137

Page 149
Image 149
Panasonic MN1030 user manual Expressions, Assembler or linker, Section CODE,PUBLIC,1, Mov Sec, A0