Download GST Computer Systems Limited

Transcript
GSI
68K/ASM Assembler
Computer Systems Limited
If the value of
to generate a
destination is
required to be
be produced and
the program.
the <expr> is relocatable the · assembler will try
PC-relative address.
This will fail if the
too far away or if the effective address is
'alterable';
in either case an enror message will
the programmer must find some other way of writing
Forward references which are undefined at the time of meeting the
symbol are assumed to be simple relocatable. If the programmer
wishes to reference an absolute address this can only be done by
coding Co. number or by coding a symbol which has previously been'
equated to a number. For example:
SCREEN
MOVE.B
#$80, SCREEN
EQU
$l8063
is not legal and will generate an error, whereas:
JMP
FRED
FRED
is legal and will generate a PC-relative addressing mode.
An immediate operand #<expr> where the <expr> is not absolute will
probably generate wrong code as the assembler does not know where
the code will be loaded and executed and is unable to add the
necessary relo catio n base(s).
Therefore the assembler will
generate warning messages if a relocatable <expr> is used as an
immediate operand.
B.4.3
Branch Instructions
The branch instructions (B cc, BSR) can use either an 8-bit PCrelative displacement or a l6-bit displacement;
the assembler
will correctly choose the most efficient option for a backwards
reference but needs some help with forward · references.
The
default option is to generate a long (l6-bit) displacement.
These branch instructions can have an explicit extent coded of .S
(short) meaning that an 8 bit displacement is to be used or .L
(long) meaning that a l6 bit displacement is to be used, for
example:
BNE.S
68K / ASM User Manual
FRED
FRED is not very far away
25
8290.6 GST 68/l.03