MOTOROLA
6-6
CENTRAL PROCESSING UNIT
M68HC11
REFERENCE MANUAL
formance.
The XIRQ mask (X bit) is used to disable interrupts from the XIRQ pin. After any reset,
X is set by default and can only be cleared by a software instruction. When XIRQ is
recognized, the X bit (and I bit) are automatically set after the registers are stacked but
before the interrupt vector is fetched. After the interrupt has been serviced, an RTI in-
struction is normally executed, causing the registers to be restored to the values that
were present before the interrupt occurred. It is logical to assume the X bit was clear
before the interrupt; thus, the X bit would be zero after the RTI was executed. Although
XIRQ can be re-enabled within an interrupt service routine, to do so is unusual be-
cause nesting of interrupts becomes possible, which requires much more program-
ming care than single-level interrupts.
6.2 Addressing Modes
In the M68HC11 CPU, six addressing modes can be used to reference memory: im-
mediate, direct, extended, indexed (with either of two 16-bit index registers and an 8-
bit offset), inherent, and relative. Some instructions require an additional byte (a pre-
byte) before the opcode to accommodate a multiple-page opcode map.
Each of the addressing modes (except inherent) results in an internally generated,
double-byte value referred to as the effective address. This value, which is the result
of a statement operand field, is the value that appears on the address bus during the
memory reference portion of the instruction. The addressing mode is an implicit part
of every M68HC11 instruction.
Bit-manipulation instructions actually employ two or three addressing modes during
execution but are classified by the addressing mode used to access the primary oper-
and. All bit-manipulation instructions use immediate addressing to fetch a bit mask,
and branch variations use relative addressing mode to determine a branch destina-
tion.
The following paragraphs provide a description of each addressing mode. In these de-
scriptions, effective address is used to indicate the memory address from which the
argument is fetched or stored or from which execution is to proceed.
6.2.1 Immediate (IMM)
In the immediate addressing mode, the actual argument is contained in the byte(s) im-
mediately following the instruction in which the number of bytes matches the size of
the register. These instructions are two, three, or four (if prebyte is required) bytes.
Machine-code byte(s) that follow the opcode are the value of the statement rather than
the address of a value. In this case, the effective address of the instruction is specified
by the character # sign and implicitly points to the byte following the opcode. The im-
mediate value is limited to either one or two bytes, depending on the size of the regis-
ter involved in the instruction. Examples of several assembly-language statements
using the immediate addressing mode are shown. Symbols and expression used in
these statements are defined immediately after the examples.