S5U1C62000A MANUAL EPSON 59
(S1C60/62 FAMILY ASSEMBLER PACKAGE)
CHAPTER 5: ASSEMBLER
Relational operators Examples Old operators
== Equal SW==0 EQ
!= Not equal SW!=0 NE
<Less than ABC<5 LT
<= Less than or equal ABC<=5 LE
>Greater than ABC>5 GT
>= Greater than or equal ABC>=5 GE
&& AND ABC&&0xf not available
|| OR ABC||0b1010 not available
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) High priority
2. ^h, ^l, ~
3. (
4. *, /, %, <<, >>
5. + (addition), - (subtraction)
6. ==, !=, <, <=, >, >=
7. &
8. |, ^
9. &&
10. ||
11.) Low priority
Examples
#define BLK_START 0x0
#define BLK_SIZE 16
#define BLK_END BLK_START+BLK_SIZE-1
#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.