
ECEN 3213 Spring 2005 Lab 4 January 27, 2005 page 1 of 4
ECEN 3213
Spring 2005
Lab 4
Due in Lab Section, Feb. 14, 16
Objective.
Gain familiarity with 6811 addressing modes.
Discussion.
The 6811 addressing modes are described in sec. 1.4.4 of the text. A similar description is
available in the TExaS help menu. The information necessary to determine the addressing
is specified in the operand field of an assembly language instruction.
Inherent Addressing. Some instructions do not specify an operand at all. This is called
“inherent” addressing. For example,
aba
takes the a and b registers as input operands and puts the result back into the a register. All
of the operands are understood from the op-code and there is no need for additional infor-
mation in the operand field.
Immediate Addressing. Immediate addressing specifies the operand value “immedi-
ately” in the operand field. This is only suitable for constants since the value cannot be
changed as the program runs. An immediate operand is specified by putting a “#” (pound
sign) at the beginning of the operand field. For example,
suba #$0A a = a - 10
suba #10 a = a - 10
suba #%1010 a = a - 10
specifies the value 10 be subtracted from register a. The value can be specified in any of
the three number bases recognized by the assembler. The size of the number must fit into
the number of bits allowed for the instruction operand. For example,
suba #$0A a = a - 10
subd #$000A d = d - 10
requires an 8-bit value to subtract from register a and a 16-bit value to subtract from the d
register.
Direct Addressing. There are two forms of direct addressing on the 6811. Direct page
addressing uses an 8-bit operand address to specify an address between $0000 and $00FF
(the upper byte is understood to be all zeros). Extended addressing uses a full 16-bit oper-
and address to specify an address anywhere else in memory between $0100 and $FFFF.