Chapter
2.
Assembly
Language
Concepts
The following list describes the classes
of
operators
in
order
of
precedence:
• Parenthesized expressions
• NUL
• HIGH,
LOW
• Multiplication/Division: *, /, MOD, SHL, SHR
•
Addition/Subtraction:
-t,
- (unary and binary)
•
Relational
Operators:
E(), L T, LE, GT, GE, NE
• Logical NOT
•
Logical AND
• Logical OR, XOR
The relational, logical, dnd HIGH/LOW operators
mu'>t
be sepdrated from their operdnds by at least one blank.
Relocatable Expressions
2-16
Determining the relocatdbility
of
an
expression requires that you understand the relocdtdbility
of
each term used
in
the expression. This
is
edsier than it sounds since the number
of
allowdble
operdtor,
is
'>ubstdntidlly reduced.
But first
it
is
necessary to know whdt determines whether d symbol i, absolute or relocdtable.
Absolute
,>ymbols can
be
defined two ways:
• A symbol that appears
in
a label field when the ASEG directive
is
in
effect
is
an absolute symbol.
• A symbol defined
as
equivalent
tJ
an
absolute expression
u,>illg
the SET
or
EQU
directive
is
an
ab'>oiute ,>ymbol.
Relocatable symbols
Cdn
be
defined a number
of
ways:
• A symbol that appears
in
a label field when the DSEG or
CSEG
directive
is
in
effect i, d relocatable
symbol.
• A
,>ymbol
defined
a'>
equivalent to a relocatable expression u',ing the SET or EQU directive
is
relocdtable.
• The special assembler symbols STACK and MEMORY
Me
r-elucltdblc.
•
External symbols
Me
considered relocatable.
• A reference to the location counter hpecified by the $ character)
is
rclocaUble when the CSEG or
DSEG directive
i'>
in
effect.
The
expres,ions shown
in
the fullowing list
<lIT
the only
expreS'>ion'>
tilat yield a rclocltdble
rc'>ult.
A'>sume
that
ABS
i,
an
dbsolutc symbol ,md RELOC
is
a rCIOc,ltablc ,ymbol:
ABS
+ RELOC
RELOC
+
ABS
RELOC
ABS
{
HIGH".) RELOC
+
ABS
LOW
/
{
HIGH)
RELOC
ABS
LOW)
(
HIGH)
RELOC +
~
LOW
ABS
{
HIGH)
RELOC:
LOW
ABS