Motorola HC12 用户手册

下载
页码 328
User’s Manual
MCUez HC12 Assembler
110
Sections
MOTOROLA
Sections
In the previous example, two bytes of storage are allocated starting at address
$A00.
 Symbol
cst1
 will be allocated at address
$A00
 and
cst2
 will be
allocated at address
$A01
. All subsequent instructions or data allocation
directives will be located in the absolute section until another section is
specified using the ORG or SECTION directive.
When using absolute sections, the user is responsible for ensuring that no
overlap exists between the different absolute sections defined in the application.
In the previous example, the programmer should ensure that the size of the
section starting at address
$A00
is not bigger than
$200
bytes; otherwise, the
sections starting at
$A00
 and
$C00
 will overlap.
When object files are generated, applications containing only absolute sections
must be linked. In that case, there should be no overlap between address ranges
from the absolute sections defined in the assembly file and address ranges
defined in the linker parameter file.
The PRM (parameter) file used to link the previous example, is defined in
LINK test.abs
/* Name of the executable file generated. */
NAMES
  test.o
/* Name of object files in the application. */
END
SEGMENTS
/* READ_ONLY memory area. There should be no overlap between this
   memory area and the absolute sections defined in the assembly
   source file. */
  MY_ROM  = READ_ONLY  0x1000 TO 0x1FFF;
/* READ_WRITE memory area. There should be no overlap between this
   memory area and the absolute sections defined in the assembly
   source file. */
  MY_RAM  = READ_WRITE 0x2000 TO 0x2FFF;
END
PLACEMENT
/* Relocatable variable sections are allocated in MY_RAM. */
  .data    INTO MY_RAM;
/* Relocatable code and constant sections are allocated in MY_ROM. */
  .text    INTO MY_ROM;
END
INIT entry
/*  Application entry point */
VECTOR ADDRESS 0xFFFE entry /* Initialization of the reset vector */
Figure 6-2. PRM File Example Code