Operating Procedures
Using Direct Addressing Mode to Access Symbols
MCUez HC12 Assembler User’s Manual
MOTOROLA Operating Procedures 233
NOTE:
The statement
NAMES test1.o test2.o END
lists the two object files
building the application. A space character separates the object filenames. The
section
CodeSec
is defined in both object files. In
test1.o
, the section
CodeSec
contains the symbol
AddSource
. In
test2.o
, the section
CodeSec
contains the symbol
entry
. According to the order in which the
object files are listed in the
NAMES
block, the function
AddSource
will be
allocated first (at address 0xB00) and symbol
entry
will be allocated next to
it.
11.6 Using Direct Addressing Mode to Access SymbolsThe different methods to inform the assembler it should use the direct
addressing mode on a symbol are discussed here.
11.6.1 Using Direct Addressing Mode to Access External Symbols
External symbols that should be accessed using the direct addressing mode,
must be declared by the directive XREF.B.
Example:
XREF.B ExternalDirLabel
XREF ExternalExtLabel
…
LDD ExternalDirLabel ; Direct addressing mode is used
…
LDD ExternalExtLabel ; Extended addressing mode is used
11.6.2 Using Direct Addressing Mode to Access Exported Symbols
Symbols that are exported using the directive XDEF.B, will be accessed by the
direct addressing mode. Symbols that are exported using the directive XDEF,
are accessed using the extended addressing mode.
Example:
XDEF.B DirLabel
XDEF ExtLabel
…
LDD DirLabel ; Direct addressing mode is used
…
LDD ExtLabel ; Extended addressing mode is used