
assembly time. They can contain constants, symbols, or any combination of
constants and symbols that are separated by arithmetic operators.
Operators specify the operations to be performed while combining the
operands of an expression. The assembler provides many operators to
combine and evaluate operands. Some operators work with integer con-
stants, some with memory values, and some with both. Operators handle
the calculation of constant values that are known at the assembly time. The
following are some operators provided by the assembler.
•
Arithmetic ope - * / % (MOD)
•
SHL and SHR operators
–
Syntax
expression SHR count
expression SHL count
The values of these shift bit operators are all constant values. The expres-
sion is shifted right (SHR) or left (SHL) by the number of bits specified by
count. If bits are shifted out of position, the corresponding bits that are
shifted in are zero-filled. The following are such examples:
mov A, 01110111b SHR 3
; result ACC=00001110b
mov A, 01110111b SHL 4
; result ACC=01110000b
•
Bitwise operators NOT, AND, OR, XOR
NOT
is a bitwise complement.
AND
is a bitwise AND.
OR
is a bitwise inclusive OR.
XOR
is a bitwise exclusive OR.
•
OFFSET operator
–
Syntax
OFFSET expression
The OFFSET operator returns the offset address of an expression. The
expression can be a label, a variable, or other direct memory operand. The
value returned by the OFFSET operator is an immediate operand.
•
LOW and HIGH operator
–
Syntax
LOW expression
HIGH expression
The LOW/HIGH operator returns the value of an expression if the result
of the expression is an immediate value. The LOW/HIGH operators will
then take the low/high byte of this value. But if the expression is a label,
Chapter 10 Assembly Language and Cross Assembler
129
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...