Operator`s manual

You write
*=
without the initial
"."
that the other
directives have
(excpi
LABEL
=
).
Also,
note that
you
write
*
=
wiihout any spaces
between
*
and
=
.
You should not
confuse ihe
*
=
directive with the LABEI-- direclive. The
*
in
*
=
is not a label. Note,
however, that the
-
=
directiv itselfmay have a label,
as
follows:
200
GO
*
=expression
500
JMP
GO
The Assembler will assemble statement 500 as
ajump to the
value
the
program
counter had BEFORE it was changed by line 200.
The
-
=
directive is useful for setting aside space needed
by
your program. For
example,
you will
frequcntly want space rcserved siarting at a
particular
loca-
tion. Use the following form:
720 TABLE35
r=*+$24
740 ...
The
efect ofthe directive is to reserve 24locaiions immediately
after TABLE3s.
Other
parts
ofyour code will not b assembled inio these locations
(unless
you
take
pains
to do so). Your
program
can use TABLE35
as an operand and
TABLX,3s
can be uscd as an element in an expression that you. instructions
ewaluate in
accessing the table.
IF Directive
900. IF expression
@LABEL
990
LABEL
End of conditional assembly
The IF directive
permiis
conditional
assembly ofblocks ofcode. In the illustra-
tion above, all the cod between lines e00 and
990
willbe
assembled ifand only
ifthe expression is equal to zerc. Ifth expression is not equal
to zero, the
IF
directive has no effect on assembly.
The xample given below shows how different parts of a source program may
b omitted from assembly according to the value assignedto the LABEL in the IF
directive. Th souce program is assembled with Z=o in one case
and
Z=1 in
another. wiih Z=0, the insiruction TAx is
assembld, and
with z=7
t]]e
ii
struction ASI- A is assembled. Obviously, this kind olselective assembly can be
SOURCE CODE
0100
;CONDITIONAL
ASSEMaIY EXAMPLE
0120 z=o
0130
*
=$5000
0140 LDA=$45
0150 . If Z@)ZNOTDQUAT-0
0160 TAX;THIS
CODE ASSDMBLDD IFF Z=0
0170 ZNOTEQUAL0
0180 . rF Z- 1@ZNOTEQUALI
0190 ASL A
;THIS
CODE ASSDMBLED IFI Z=1
02oo ZNOTEQUALI
0210 INX;THIS
CODE ALWAYS ASSEMBLED
t{!
w l
Wa