M68HC11
REFERENCE MANUAL
CENTRAL PROCESSING UNIT
MOTOROLA
6-7
The first three statements are assembler directives that set up values to be used in the
remaining statements. The remaining nine statements are examples of immediate ad-
dressing. The value of each statement operand field appears in byte(s) immediately
following the opcode. The operand field for immediate addressing begins with the
character # sign. The character # sign is used by the assembler to detect the immedi-
ate mode of addressing. A very common programming error is to forget this character
# sign.
Machine Code
Label
CAT
Operation
EQU
ORG
EQU
LDAA
EORB
CMPA
Operand
7
$1000
*
#22
#$34
#%100100
Comments
CAT SAME AS 7
SET LOCATION COUNTER
ADDR(REGS) IS $1000
DECIMAL 22
ACCA ($16)
XOR ($34,ACCB)
ACCB
RIGHT ALIGNED BINARY
REGS
86 16
C8 34
81 24
86 07
CC 12 34
CC 00 07
LDAA
LDD
LDD
#CAT
#$1234
#7
7
ACCA
7
ACCA:ACCB
86 12
86 41
CE 10 00
A variety of symbols and expressions can be used following the character # sign.
Since not all assemblers use the same rules of syntax and special characters, the user
should refer to the documentation for the particular assembler that will be used. Char-
acter prefixes used in the previous example statements are defined as follows:
LDAA
LDAA
LDX
#@22
#’A
#REGS
OCTAL
ASCII
ADDR(REGS)
X
6.2.2 Extended (EXT)
In the extended addressing mode, the effective address of the instruction appears ex-
plicitly in the two bytes following the opcode. Therefore, the length of most instructions
using the extended addressing mode is three bytes: one for the opcode and two for
the effective address. The last two bytes of the instruction contain the absolute ad-
dress of the operand. These instructions are three or four (if prebyte is required) bytes:
one or two for the opcode and two for the effective address. Instructions from the sec-
ond, third, and fourth opcode map pages require a page-select prebyte prior to the op-
code byte. Only four extended addressing mode instructions involving index register
Y require this extra prebyte.
Examples of assembly-language statements that use extended addressing mode are
grouped with direct addressing mode examples and appear after the discussion of the
direct addressing mode.
Prefix
None
$
@
%
’
Definition
Decimal
Hexadecimal
Octal
Binary
Single ASCII Character