Motorola HC12 Manuel D’Utilisation
![Motorola](https://files.manualsbrain.com/attachments/83de88ba2280e7232128e8931d7cbd2a38dcc654/common/fit/150/50/0293f422c4d32e7e0f777d5e11bc33c83ea5627f71ddf155374c02a23d9a/brand_logo.png)
Assembler Syntax
Source Line
MCUez HC12 Assembler
User’s Manual
MOTOROLA
Assembler Syntax
131
One very common programming error is to omit the # character. This causes the
assembler to misinterpret the expression as an address rather than explicit data.
assembler to misinterpret the expression as an address rather than explicit data.
Example:
LDAA $60
means load accumulator A with the value stored at address
$60
.
7.4.3.3 Direct
The direct addressing mode is used to access operands in the direct page of the
memory (location $0000 to $00FF).
memory (location $0000 to $00FF).
Access to this memory range (also called zero page) is faster and requires less
code than the extended addressing mode (see next example). To speed up the
application, a programmer can place the most commonly accessed data in this
area of memory.
code than the extended addressing mode (see next example). To speed up the
application, a programmer can place the most commonly accessed data in this
area of memory.
Example:
ORG $50
data: DS.B 1
MyCode: SECTION
Entry:
LDS #$AFE
; init Stack Pointer
LDAA #$01
main: STAA data
BRA main
In this example, the value in register A is stored in the variable
data
which is
located at address
$50
.