Motorola HC12 Manuale Utente

Pagina di 328
Operating Procedures
Splitting an Application into Different Modules
MCUez HC12 Assembler
User’s Manual
MOTOROLA
Operating Procedures
231
11.5  Splitting an Application into Different Modules
A complex application or application involving several programmers can be
split into several simple modules. In order to avoid any problem when merging
different modules, adhere to the following.
For each assembly source file, one include file must be created containing the
definition of the symbols exported from this module. For the symbols referring
to code label, a small description of the interface is required.
Example of assembly file (Test1.asm):
         XDEF AddSource
         XDEF Source
 initStack:EQU $AFF
 DataSec: SECTION
 Source:   DS.W 1
 CodeSec:  SECTION
 AddSource:
           ADD Source
           STD Source
           RTS
Corresponding include file (Test1.inc):
         XREF AddSource
         XREF AddSource
 ; The function AddSource adds the value stored in the variable
 ; Source to the content of register D. The result of the computation
 ; is stored in the variable Source.
 ;
 ; Input Parameter : register D contains the value, which should be
 ;                   added to the variable Source.
 ; Output Parameter: register D contains the result of the addition.
         XREF Source
 ; The variable Source is a word variable.