User’s Manual MCUez HC12 Assembler
218 Operating Procedures MOTOROLA
Operating Procedures
11.2 Introduction
This section provides operating procedures for the MCUez assembler.
11.2.1 Working with Absolute Sections
An absolute section has its start address known at assembly time. (See modules
fiboorg.asm and fiboorg.prm in the demo directory.)
11.2.2 Defining Absolute Sections in the Assembly Source File
An absolute section is defined by the directive ORG. The macro assembler
generates a pseudo section named ORG_<index>, where <index> is an integer
which is incremented each time an absolute section is encountered.
Example:
Defining an absolute section containing data:
ORG $A00 ;Absolute constant data section
cst1: DC.B $A6
cst2: DC.B $BC
ORG $800 ; Absolute data section.
var: DS.B 1
In the previous example code, the label cst1 will be located at address $A00,
and label cst2 will be located at address $A01, as shown in this code listing.
1 1 ORG $A00
2 2 a000A00 A6 cst1: DC.B $A6
3 3 a000A01 BC cst2: DC.B $BC
4 4 ORG $800
5 5 a000800 var: DS.B 1
Defining an absolute section containing code:
ORG $C00 ; Absolute code section.
entry:
LDAA cst1 ; Load value in cst1
ADDA cst2 ; Add value in cst2
STAA var ; Store in var
BRA entry