Section 3: CPU Core
MOTOROLA
Page 15
MC68HC05C0 Specification Rev. 1.2
3.1.5.4
Zero (Z)
When set, this bit indicates that the result of the last arithmetic, logical, or data manipulation
was zero.
3.1.5.5
Carry/Borrow (C)
When set, this bit indicates that a carry or borrow out of the arithmetic logical unit (ALU)
occurred during the last arithmetic operation. This bit is also affected during bit test and
branch instructions and during shifts and rotates.
3.2
ADDRESSING MODES
The MCU uses ten different addressing modes to provide the programmer with an
opportunity to optimize the code for all situations. The various indexed addressing modes
make it possible to locate data tables, code conversion tables, and scaling tables anywhere
in the memory space. Short indexed accesses are single byte instructions; the longest
instructions (three bytes) permit accessing tables throughout memory. Short and long
absolute addressing is also included. One- or two-byte direct addressing instructions
access all data bytes in most applications. Extended addressing permits jump instructions
to reach all memory.
The term “effective address” (EA) is used in describing the various addressing modes.
Effective address is defined as the address at which the argument for an instruction is
fetched or stored.
3.2.1
IMMEDIATE
In the immediate addressing mode, the operand is contained in the byte immediately
following the opcode byte. The immediate addressing mode is used to access constants
that do not change during program execution (e.g., a constant used to initialize a loop
counter).
3.2.2
DIRECT
In the direct addressing mode, the effective address of the argument is contained in a single
byte following the opcode byte. Direct addressing allows the user to directly address the
lowest 256 bytes in memory with a single two-byte instruction.
3.2.3
EXTENDED
In the extended addressing mode, the effective address of the argument is contained in the
two bytes following the opcode byte. Instructions with extended addressing mode are
capable of referencing arguments anywhere in memory with a single three-byte instruction.
When using the Motorola assembler, the user need not specify whether an instruction uses
direct or extended addressing. The assembler automatically selects the shortest form of the
instruction.
3.2.4
RELATIVE
The relative addressing mode is used only in branch instructions. In relative addressing,
the contents of the 8-bit signed offset byte, which is the last byte of the instruction, is added
to the PC if, and only if, the branch conditions are true. Otherwise control proceeds to the