Chapter
2. Assembly Language
Concepts
2-6
Location Counter. The $ character refers to the current location counter. The location counter contains the
address where the current instruction or data statement
will
be
assembled.
Label
Opcode
GO:
)MP
Operand
$+6
Comment
;)
UMP
TO ADDRESS 6 BYTES BEYOND
;THE FIRST BYTE OF THIS
;INSTRUCTION
ASCII
Constant. One or more
ASCII
characters enclosed
in
singte quotes define an ASCII constant. Two
successive single quotes must be used to represent one single quote within
an
ASCII
constant.
Label Opcode
MVI
DATE:
DB
Operand
F
'*'
-,
Comment
;LOAD E
REG
WITH
8-BIT ASCII
;REPRESENTATION OF
*
'TODAY"S DATE'
Labels Assigned Values. The SET
dnd
EQU
directives can a,sign values to label'..
In
the following example,
assume that VALUE has been assigned
the \alue 9FH; the two stdtement,
Me
equivalent:
Label
A1:
A2:
Opcode
MVI
MVI
Operand
D,9FH
D,VALUE
Comment
Labels
of
Instruction or Data. The label as<igned to an instruction or a data definition
ha'>
as
its vdlue the
address of the
first byte
of
the instruction or data. Instructions elsewhel'e
in
the progrdm can refer to this
address
by
its symbolic label name.
Label Opcode
Operand
Comments
HERE: )MP
THERE ;)UMP
TO
INSTRUCTION
AT
THERE
THERE:
MVI
D,9FH
Expressions.
All
of the operand types discllssed previously can
be
comlJined
by
operators to form an expression.
In
fact, the example given for the location counter ($+6) i,
dn
expression that combines the location counter
with the decimal number 6.
Becduse
the rule, for coding expressions are rather extensive, further
discu"ion
of
expressions
is
deferred until
later
in
this chapter.