8 symbols, 9 operators – Epson S5U1C62000A User Manual

Page 70

Advertising
background image

58

EPSON

S5U1C62000A MANUAL

(S1C60/62 FAMILY ASSEMBLER PACKAGE)

CHAPTER 5: ASSEMBLER

5.5.8 Symbols

The .set and #define pseudo-instr uctions allow definition of values as symbols.

Examples:

.set ADDR1 0x0f0

... ADDR1 is a symbol that represents absolute address 0x0f0.

#define CONST 0xf

... CONST is a symbol that represents data 0x0f.

:

ld

a,CONST

... Will be expanded into "ld a, 0xf".

The defined symbols can be used for specifying the immediate data of instructions. They are expanded
into the defined value in the preprocess stage and the symbol information does not output to the object
file. Therefore, these symbols cannot be allowed as labels used for symbolic debugging.

Restrictions

• The maximum number of characters of a symbol is limited to 259 the same as that of one line.

• The characters that can be used are limited to the following:

A–Z a–z _ 0–9 ?

Note that a symbol cannot begin with a numeral. Uppercase and lowercase characters are discrimi-
nated.

5.5.9 Operators

An expression that consists of operators, numbers and/or defined symbols (including labels) can be used
for specifying a number or defining a Define name (only for number definition).
The preprocess in the assembler handles expressions in signed 16-bit data and expands them as hexadeci-
mal numbers.

Types of operators

Arithmetic operators

Examples

Old operators (for asm62XX)

+

Addition, Plus sign

+0xff, 1+2

+

-

Subtraction, Minus sign

-1+2, 0xff-0b111

-

*

Multiplication

0xf*5

*

/

Division

0x123/0x56

/

%

Residue

0x123%0x56

MOD

>>

Shifting to right

1>>2

SHR

<<

Shifting to left

0x113<<3

SHL

^H

Acquires upper 8 bits

0x1234^H

HIGH

^L

Acquires lower 8 bits

0x1234^L

LOW

( )

Parenthesis

1+(1+2*5)

not available

The arithmetic operator returns the result of arithmetic operation on the specified terms.

Logical operators

Examples

Old operators

&

Bit AND

0b1101&0b111

AND

|

Bit OR

0b123|0xff

OR

^

Bit XOR

12^35

XOR

~

Bit inversion

~0x1234

NOT

The logical operator returns the result of logic operation on the specified terms.

Advertising