Example 2:
mov A, BANK var
mov BP,A
mov A, OFFSET var
mov MP1,A
mov A,IAR1
·
Operator precedence
Precedence
Operators
1 (Highest)
2
3
4
5
6
7
8
9 (Lowest)
( ), [ ]
+,
-
(unary), LOW, MID, HIGH, OFFSET, BANK
*, /, %, SHL, SHR
+,
-
(binary)
> (greater than), >= (greater than or equal to),
< (less than), <= (less than or equal to)
== (equal to), != (not equal to)
! (bitwise NOT)
& (bitwise AND)
|(bitwise OR), ^(bitwise XOR)
Miscellaneous
Forward References
The Cross Assembler allows reference to labels, variable names, and other symbols before they
are declared in the source code (forward named references). But symbols to the right of
EQU
are
not allowed to be forward referenced.
Local Labels
A local label is a label with a fixed form such as $number. The number can be 0~29. The function of
a local label is the same as a label except that the local label can be used repeatedly. The local la-
bel should be used between any two consecutive labels and the same local label name may used
between other two consecutive labels. The Cross Assembler will transfer every local label into a
unique label before assembling the source file. At most 30 local labels can be defined between two
consecutive labels.
Example.
Label1:
; label
$1:
;; local label
mov a, 1
jmp $3
$2:
;; local label
mov a, 2
jmp $1
$3:
;; local label
jmp $2
Label2:
; label
jmp $1
$0:
;; local label
jmp Label1
$1:
jmp $0
Label3:
114
A/D Type MCU
Summary of Contents for HT46R22
Page 7: ...vi A D Type MCU...
Page 9: ...viii A D Type MCU...
Page 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Page 11: ...2 A D Type MCU...
Page 90: ...P a r t I I Programming Language Part II Programming Language 81...
Page 91: ...82 A D Type MCU...
Page 97: ...88 A D Type MCU...
Page 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Page 129: ...120 A D Type MCU...
Page 140: ...Appendix Appendix 131...
Page 141: ...132 A D Type MCU...
Page 151: ...142 A D Type MCU...
Page 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Page 161: ...A D Type MCU...
Page 162: ...Amendments...