Epson S5U1C62000A Manual page 71

Epson cmos 4-bit single chip microcomputer manual
Table of Contents

Advertisement

Relational operators
Equal
==
!=
Not equal
Less than
<
<=
Less than or equal
Greater than
>
>=
Greater than or equal
&&
AND
||
OR
The relational operator returns 1 if the expression is true, otherwise it returns 0.
Priority
The operators have the priority shown below. If there are two or more operators with the same
priority in an expression, the assembler calculates the expression from the left.
1. + (plus sign), - (minus sign)
2. ^h, ^l, ~
3. (
4. *, /, %, <<, >>
5. + (addition), - (subtraction)
6. ==, !=, <, <=, >, >=
7. &
8. |, ^
9. &&
10. ||
11. )
Examples
#define BLK_START 0x0
#define BLK_SIZE
#define BLK_END
#define INIT_DATA 0xaa
:
LOOP:
ld
a,BLK_START^h>>4&0xf
ld
xh,a
ld
b,BLK_START^l&0xf
ld
xl,b
ldpx mx,(((INIT_DATA&0x80)!=0)*2+INIT_DATA)>>4&0xf
ldpx mx,(((INIT_DATA&0x80)!=0)*2+INIT_DATA)&0xf
cp
a,BLK_END>>4&0xf
JP
NZ,LOOP
cp
b,BLK_END&0xf
JP
NZ,LOOP
Compatibility with the older tools
The assembler supports the old-type operators for the asm62XX shown in "Types of operators".
They have the same priority as the corresponding new-type operators. Consequently, it is possible to
use sources created for the older tools.
The old-type operators are converted into the new format in the preprocessing stage.
S5U1C62000A MANUAL
(S1C60/62 FAMILY ASSEMBLER PACKAGE)
Examples
SW==0
SW!=0
ABC<5
ABC<=5
ABC>5
ABC>=5
ABC&&0xf
ABC||0b1010
High priority
Low priority
16
BLK_START+BLK_SIZE-1
EPSON
CHAPTER 5: ASSEMBLER
Old operators
EQ
NE
LT
LE
GT
GE
not available
not available
59

Advertisement

Table of Contents
loading

Table of Contents