CPU08RM
CPU08RM
Reference Manual
M68HC08
Microcontrollers
CPU08RM/AD
Rev. 3, 2/2001
WWW.MOTOROLA.COM/SEMICONDUCTORS
blank
CPU08
Central Processor Unit
Reference Manual
Motorola reserves the right to make changes without further notice to any products
herein. Motorola makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor does Motorola assume any
liability arising out of the application or use of any product or circuit, and specifically
disclaims any and all liability, including without limitation consequential or incidental
damages. "Typical" parameters which may be provided in Motorola data sheets and/or
specifications can and do vary in different applications and actual performance may
vary over time. All operating parameters, including "Typicals" must be validated for
each customer application by customer’s technical experts. Motorola does not convey
any license under its patent rights nor the rights of others. Motorola products are not
designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Motorola product could create a
situation where personal injury or death may occur. Should Buyer purchase or use
Motorola products for any such unintended or unauthorized application, Buyer shall
indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and
reasonable attorney fees arising out of, directly or indirectly, any claim of personal
injury or death associated with such unintended or unauthorized use, even if such claim
alleges that Motorola was negligent regarding the design or manufacture of the part.
Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.
MOTOROLA 3
Reference Manual
4 MOTOROLA
Reference Manual — CPU08
List of Sections
Section 2. Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Table of Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Section 2. Architecture
2.1 Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Glossary
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Index
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
List of Figures
List of Tables
1.1 Contents
1.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.2 Introduction
The CPU08 is the central processor unit (CPU) of the Motorola
M68HC08 Family of microcontroller units (MCU). The fully object code
compatible CPU08 offers M68HC05 users increased performance with
no loss of time or software investment in their M68HC05-based
applications. The CPU08 also appeals to users of other MCU
architectures who need the CPU08 combination of speed, low power,
processing capabilities, and cost effectiveness.
1.3 Features
CPU08 features include:
• Full object-code compatibility with M68HC05 Family
• 16-bit stack pointer with stack manipulation instructions
• 16-bit index register (H:X) with high-byte and low-byte
manipulation instructions
• 8-MHz CPU standard bus frequency
• 64-Kbyte program/data memory space
• 16 addressing modes
• 78 new opcodes
• Memory-to-memory data moves without using accumulator
• Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions
• Enhanced binary-coded decimal (BCD) data handling
• Expandable internal bus definition for extension of addressing
range beyond 64 Kbytes
• Flexible internal bus definition to accommodate CPU
performance-enhancing peripherals such as a direct memory
access (DMA) controller
• Low-power stop and wait modes
Section 2. Architecture
2.1 Contents
2.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Introduction
This section describes the CPU08 registers.
MOTOROLA Architecture 23
Architecture
7 0
A ACCUMULATOR (A)
15 8 7 0
15 0
15 0
7 0
CONDITION CODE
V 1 1 H I N Z C REGISTER (CCR)
24 Architecture MOTOROLA
Architecture
CPU08 Registers
2.3.1 Accumulator
Bit 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Reset: X X X X X X X X
X = Indeterminate
The 16-bit index register (H:X) shown in Figure 2-3 allows the user to
index or address a 64-Kbyte memory space. The concatenated 16-bit
register is called H:X. The upper byte of the index register is called H.
The lower byte of the index register is called X. H is cleared by reset.
When H = 0 and no instructions that affect H are used, H:X is functionally
identical to the IX register of the M6805 Family.
In the indexed addressing modes, the CPU uses the contents of H:X to
determine the effective address of the operand. H:X can also serve as a
temporary data storage location. See 4.3.5 Indexed, No Offset;
4.3.6 Indexed, 8-Bit Offset; and 4.3.7 Indexed, 16-Bit Offset.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Reset: X X X X X X X X X X X X X X X X
X = Indeterminate
MOTOROLA Architecture 25
Architecture
The stack pointer (SP) shown in Figure 2-4 is a 16-bit register that
contains the address of the next location on the stack. During a reset, the
stack pointer is preset to $00FF to provide compatibility with the M6805
Family.
NOTE: The reset stack pointer (RSP) instruction sets the least significant byte
to $FF and does not affect the most significant byte.
The address in the stack pointer decrements as data is pushed onto the
stack and increments as data is pulled from the stack. The SP always
points to the next available (empty) byte on the stack.
The CPU08 has stack pointer 8- and 16-bit offset addressing modes that
allow the stack pointer to be used as an index register to access
temporary variables on the stack. The CPU uses the contents in the SP
register to determine the effective address of the operand. See
4.3.8 Stack Pointer, 8-Bit Offset and 4.3.9 Stack Pointer, 16-Bit
Offset.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Read:
Write:
Reset: 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
NOTE: Although preset to $00FF, the location of the stack is arbitrary and may
be relocated by the user to anywhere that random-access memory
(RAM) resides within the memory map. Moving the SP out of page 0
($0000 to $00FF) will free up address space, which may be accessed
using the efficient direct addressing mode.
26 Architecture MOTOROLA
Architecture
CPU08 Registers
The program counter (PC) shown in Figure 2-5 is a 16-bit register that
contains the address of the next instruction or operand to be fetched.
During reset, the PC is loaded with the contents of the reset vector
located at $FFFE and $FFFF. This represents the address of the first
instruction to be executed after the reset state is exited.
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Bit 0
Read:
Write:
MOTOROLA Architecture 27
Architecture
The 8-bit condition code register (CCR) shown in Figure 2-6 contains
the interrupt mask and five flags that indicate the results of the instruction
just executed. Bits five and six are permanently set to logic 1.
Bit 7 6 5 4 3 2 1 Bit 0
Read:
V 1 1 H I N Z C
Write:
Reset: X 1 1 X 1 X X X
X = Indeterminate
V — Overflow Flag
The CPU sets the overflow flag when a two's complement overflow
occurs as a result of an operation. The overflow flag bit is utilized by
the signed branch instructions:
Branch if greater than, BGT
Branch if greater than or equal to, BGE
Branch if less than or equal to, BLE
Branch if less than, BLT
This bit is set by these instructions, although its resulting value holds
no meaning:
Arithmetic shift left, ASL
Arithmetic shift right, ASR
Logical shift left, LSL
Logical shift right, LSR
Rotate left through carry, ROL
Rotate right through carry, ROR
H — Half-Carry Flag
The CPU sets the half-carry flag when a carry occurs between bits 3
and 4 of the accumulator during an add-without-carry (ADD) or
add-with-carry (ADC) operation. The half-carry flag is required for
28 Architecture MOTOROLA
Architecture
CPU08 Registers
I — Interrupt Mask
When the interrupt mask is set, all interrupts are disabled. Interrupts
are enabled when the interrupt mask is cleared. When an interrupt
occurs, the interrupt mask is automatically set after the CPU registers
are saved on the stack, but before the interrupt vector is fetched.
N — Negative Flag
The CPU sets the negative flag when an arithmetic operation, logical
operation, or data manipulation produces a negative result.
Z — Zero Flag
The CPU sets the zero flag when an arithmetic operation, logical
operation, or data manipulation produces a result of $00.
C — Carry/Borrow Flag
The CPU sets the carry/borrow flag when an addition operation
produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some logical operations and data
manipulation instructions also clear or set the carry/borrow flag (as in
bit test and branch instructions and shifts and rotates).
MOTOROLA Architecture 29
Architecture
The CPU08, as shown in Figure 2-7, is divided into two main blocks:
• Control unit
• Execution unit
The control unit contains a finite state machine along with miscellaneous
control and timing logic. The outputs of this block drive the execution
unit, which contains the arithmetic logic unit (ALU), registers, and bus
interface.
CONTROL UNIT
CONTROL STATUS
SIGNALS SIGNALS
EXECUTION UNIT
INTERNAL
DATA BUS
INTERNAL
ADDRESS BUS
30 Architecture MOTOROLA
Architecture
CPU08 Functional Description
The CPU08 derives its timing from a 4-phase clock, each phase
identified as either T1, T2, T3, or T4. A CPU bus cycle consists of one
clock pulse from each phase, as shown in Figure 2-8. To simplify
subsequent diagrams, the T clocks have been combined into a single
signal called the CPU clock. The start of a CPU cycle is defined as the
leading edge of T1, though the address associated with this cycle does
not drive the address bus until T3. Note that the new address leads the
associated data by one-half of a bus cycle.
For example, the data read associated with a new PC value generated
in T1/T2 of cycle 1 in Figure 2-8 would not be read into the control unit
until T2 of the next cycle.
T1
T2
T3
T4
CYCLE 1 CYCLE 2
CPU CLOCK T1 T2 T3 T4 T1 T2 T3 T4
INTERNAL
ADDRESS BUS ADDR. CYCLE N
INTERNAL
DATA BUS DATA CYCLE
EXECUTE
CYCLE N
MOTOROLA Architecture 31
Architecture
These blocks make up a finite state machine, which generates all the
controls for the execution unit.
The sequencer provides the next state of the machine to the control store
based on the contents of the instruction register (IR) and the current state
of the machine. The control store is strobed (enabled) when the next state
input is stable, producing an output that represents the decoded next state
condition for the execution unit (EU). This result, with the help of some
random logic, is used to generate the control signals that configure the
execution unit. The random logic selects the appropriate signals and adds
timing to the outputs of the control store. The control unit fires once per bus
cycle but runs almost a full cycle ahead of the execution unit to decode
and generate all the controls for the next cycle. The sequential nature of
the machine is shown in Figure 2-9.
32 Architecture MOTOROLA
Architecture
CPU08 Functional Description
CPU CLOCK T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4
IR/CONTROL UNIT
CYCLE N STATE
STATE INPUT
CONTROL UNIT
STROBE CYCLE N STROBE
INTERNAL ADDRESS
ADDRESS BUS CYCLE N
INTERNAL
DATA BUS DATA CYCLE N
FETCH/DECODE EXECUTE
CYCLE N CYCLE N
The execution unit (EU) contains all the registers, the arithmetic logic
unit (ALU), and the bus interface. Once per bus cycle a new address is
computed by passing selected register values along the internal address
buses to the address buffers. Note that the new address leads the
associated data by one half of a bus cycle. The execution unit also
contains some special function logic for unusual instructions such as
DAA, unsigned multiply (MUL), and divide (DIV).
MOTOROLA Architecture 33
Architecture
Note that all instructions are also responsible for incrementing the PC
after the next instruction prefetch is under way. Therefore, when an
instruction finishes (that is, at an instruction boundary), the PC will be
pointing to the byte following the opcode fetched by the instruction. An
example sequence of instructions concerning address and data bus
activity with respect to instruction boundaries is shown in Figure 2-10.
ORG $50
ORG $100
34 Architecture MOTOROLA
Architecture
CPU08 Functional Description
CPU CLOCK T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4
OPCODE
LOOKAHEAD TAX OPCODE LDA OPCODE INCX OPCODE
REGISTER
LASTBOX
OPCODE LOOKAHEAD
IR/CONTROL
UNIT STATE TAX LDA STATE 1 LDA STATE 2 LDA STATE 3 INCX STATE 1
STATE 1
INPUT
CONTROL UNIT
LDA CYCLE 1 LDA CYCLE 2 LDA CYCLE 3
OUTPUT TO TAX EU CONTROL
EU CONTROL EU CONTROL EU CONTROL
EXECUTION UNIT
LDA OPCODE STA OPCODE
PREFETCH LDA OFFSET FETCH INCX OPCODE PREFETCH LDA OPERAND READ PREFETCH
INTERNAL
ADDRESS BUS $0103 $0104 $0105 $0052 $0106
INSTRUCTION
EXECUTION TAX LDA
BOUNDARIES
MOTOROLA Architecture 35
Architecture
36 Architecture MOTOROLA
Reference Manual — CPU08
3.1 Contents
3.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2 Introduction
The CPU08 in a microcontroller executes instructions sequentially. In
many applications it is necessary to execute sets of instructions in
response to requests from various peripheral devices. These requests
are often asynchronous to the execution of the main program. Resets
and interrupts are both types of CPU08 exceptions. Entry to the
appropriate service routine is called exception processing.
3.3.1 Recognition
All pending interrupts are recognized by the CPU08 during the last cycle
of each instruction. Interrupts that occur during the last cycle will not be
recognized by the CPU08 until the last cycle of the following instruction.
Instruction execution cannot be suspended to service an interrupt, and
so interrupt latency calculations must include the execution time of the
longest instruction that could be encountered.
3.3.2 Stacking
7 0
UNSTACKING
ORDER
•
•
•
5 1 CONDITION CODE REGISTER
4 2 ACCUMULATOR
3 3 INDEX REGISTER (LOW BYTE X)(1)
2 4 PROGRAM COUNTER HIGH
1 5 PROGRAM COUNTER LOW
•
•
•
STACKING
ORDER
NOTE: To maintain compatibility with the M6805 Family, H (the high byte of the
index register) is not stacked during interrupt processing. If the interrupt
service routine modifies H or uses the indexed addressing mode, it is
the user’s responsibility to save and restore it prior to returning.
See Figure 3-2.
IRQINT PSHH
|
|Interrupt service routine
|
|
PULH
RTI
3.3.3 Arbitration
All reset sources always have equal and highest priority and cannot be
arbitrated. Interrupts are latched, and arbitration is performed in the
system integration module (SIM) at the start of interrupt processing. The
arbitration result is a constant that the CPU08 uses to determine which
vector to fetch. Once an interrupt is latched by the SIM, no other interrupt
may take precedence, regardless of priority, until the latched interrupt is
serviced (or the I bit is cleared). See Figure 3-3.
UNSTACK A 3
2 STACK PCL
RTI
UNSTACK X 4
3 STACK PCH
UNSTACK PCH 5
INTERRUPT PROCESSING
4 STACK X
UNSTACK PCL 6
5 STACK A
FETCH NEXT
INSTRUCTION (B) 7
6 STACK CCR
FETCH VECTOR
7 INTERRUPT HIGH BYTE
YES
INTERRUPT START INTERRUPT
PENDING? PROCESSING
FETCH VECTOR
8 INTERRUPT LOW BYTE NOTE 1 NO
3.3.4 Masking
In all cases where the I bit can be modified, it is modified at least one
cycle prior to the last cycle of the instruction or operation, which
guarantees that the new I-bit state will be effective prior to execution of
the next instruction. For example, if an interrupt is recognized during the
CLI instruction, the load accumulator from memory (LDA) instruction will
not be executed before the interrupt is serviced. See Figure 3-4.
CLI
INT1 PSHH
|
| INT1 Interrupt Service
| Routine
PULH
RTI
INT1 PSHH
|
INT1 Interrupt Service
| Routine
PULH
RTI
INT2 PSHH
|
| INT2 Interrupt Service
Routine
PULH
RTI
INT1 PSHH
|
INT1 Interrupt Service
| Routine
PULH
RTI
Unstacking the CCR generally clears the I bit, which is cleared during the
second cycle of the RTI instruction.
NOTE: Since the return I bit state comes from the stacked CCR, the user, by
setting the I bit in the stacked CCR, can block all subsequent interrupts
pending or otherwise, regardless of priority, from within an interrupt
service routine.
LDA #$08
ORA 1,SP
STA 1,SP
RTI
CPU CLOCK T3 T4 T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4 T1 T2 T3 T4
INTERNAL
ADDRESS BUS INDETERMINATE $FFFE $FFFF
INTERNAL
DATA BUS INDETERMINATE PCH
RESET PIN
RESET PIN SAMPLING
The reset system is able to actively pull down the reset output if
reset-causing conditions are detected by internal systems. This feature
can be used to reset external peripherals or other slave MCU devices.
Once the reset condition is recognized, internal registers and control bits
are forced to an initial state. These initial states are described throughout
this manual. These initial states in turn control on-chip peripheral
systems to force them to known startup states. Most of the initial
conditions are independent of the operating mode. This subsection
summarizes the initial conditions of the CPU08 and input/output (I/O) as
they leave reset.
3.4.2 CPU
After reset the CPU08 fetches the reset vector from locations $FFFE and
$FFFF (when in monitor mode, the reset vector is fetched from $FEFE
and $FEFF), loads the vector into the PC, and begins executing
instructions. The stack pointer is loaded with $00FF. The H register is
cleared to provide compatibility for existing M6805 object code. All other
CPU08 registers are indeterminate immediately after reset; however, the
I interrupt mask bit in the condition code register is set to mask any
interrupts, and the STOP and WAIT latches are both cleared.
The monitor mode is the same as user mode except that alternate
vectors are used by forcing address bit A8 to 0 instead of 1. The reset
vector is therefore fetched from addresses $FEFE and FEFF instead of
FFFE and FFFF. This offset allows the CPU08 to execute code from the
internal monitor firmware instead of the user code. (Refer to the
appropriate technical data manual for specific information regarding the
internal monitor description.)
The mode of operation is latched on the rising edge of the reset pin. The
monitor mode is selected by connecting two port lines to Vss and
applying an over-voltage of approximately 2 x VDD to the IRQ1 pin
concurrent with the rising edge of reset (see Table 3-1). Port allocation
varies from port to port.
≤ VDD X X User
2 x VDD 1 0 Monitor
The system integration module (SIM) has master reset control and may
include, depending on device implementation, any of these typical reset
sources:
• External reset (RESET pin)
• Power-on reset (POR) circuit
• COP watchdog
• Illegal opcode reset
• Illegal address reset
• Low voltage inhibit (LVI) reset
A logic 0 applied to the RESET pin asserts the internal reset signal,
which halts all processing on the chip. The CPU08 and peripherals are
reset.
All internal reset sources actively pull down the RESET pin to allow the
resetting of external peripherals. The RESET pin will be pulled down for
16 bus clock cycles; the internal reset signal will continue to be asserted
for an additional 16 cycles after that. If the RESET pin is still low at the
the end of the second 16 cycles, then an external reset has occurred. If
the pin is high, the appropriate bit will be set to indicate the source of the
reset.
The active reset feature allows the part to issue a reset to peripherals
and other chips within a system built around an M68HC08 MCU.
Upon reset, the I bit is set to inhibit all interrupts. After minimum system
initialization, software may clear the I bit by a TAP or CLI instruction, thus
enabling interrupts.
The CPU08 can have 128 separate vectors including reset and software
interrupt (SWI), which leaves 126 inputs for independent interrupt
sources. See Table 3-2.
NOTE: Not all CPU08 versions use all available interrupt vectors.
FFFE Reset 1
FFFC SWI 2
FFFA IREQ[0] 3
: : :
FF02 IREQ[124] 127
NOTE: The interrupt source priority for any specific module may not always be
the same in different M68HC08 versions. For details about the priority
assigned to interrupt sources in a specific M68HC08 device, refer to the
SIM section of the technical data manual written for that device.
As an instruction, SWI has the highest priority other than reset; once the
SWI opcode is fetched, no other interrupt can be honored until the SWI
vector has been fetched.
In wait mode the CPU clocks are disabled, but other module clocks
remain active. A module that is active during wait mode can wake the
CPU08 by an interrupt if the interrupt is enabled. Processing of the
interrupt begins immediately.
In stop mode, the system clocks do not run. The system control module
inputs are conditioned so that they can be asynchronous. A particular
module can wake the part from stop mode with an interrupt provided that
the module has been designed to do so.
4.1 Contents
4.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.2 Introduction
This section describes the addressing modes of the M68HC08 central
processor unit (CPU).
4.3.1 Inherent
Machine
Label Operation Operand Comments
Code
4.3.2 Immediate
The example code shown here contains two immediate instructions: AIX
(add immediate to H:X) and CPHX (compare H:X with immediate value).
H:X is first cleared and then incremented by one until it contains $FFFF.
Once the condition specified by the CPHX becomes true, the program
branches to START, and the process is repeated indefinitely.
Machine
Label Operation Operand Comments
Code
5F START CLRX ;X = 0
8C CLRH ;H = 0
AF01 TAG AIX #1 ;(H:X) = (H:X) + 1
65FFFF CPHX #$FFFF ;Compare (H:X) to
;$FFFF
26F9 BNE TAG ;Loop until equal
20F5 BRA START ;Start over
4.3.3 Direct
Most direct instructions can access any of the first 256 memory
addresses with only two bytes. The first byte is the opcode, and the
second is the low byte of the operand address. The high-order byte of
the effective address is assumed to be $00 and is not included as an
instruction byte (saving program memory space and execution time).
The use of direct addressing mode is therefore limited to operands in the
$0000–$00FF area of memory (called the direct page or page 0).
BRSET and BRCLR are 3-byte instructions that use direct addressing to
access the operand and relative addressing to specify a branch
destination.
CPHX, STHX, and LDHX are 2-byte instructions that fetch a 16-bit
operand. The most significant byte comes from the direct address; the
least significant byte comes from the direct address + 1.
Machine
Label Operation Operand Comments
Code
4.3.4 Extended
When using most assemblers, the programmer does not need to specify
whether an instruction is direct or extended. The assembler
automatically selects the shortest form of the instruction. Table 4-4 lists
the instructions that use the extended addressing mode. An example of
the extended addressing mode is shown here.
Machine
Label Operation Operand Comments
Code
ORG $50 ;Start at $50
FCB $FF ;$50 = $FF
5F CLRX
BE50 LDX $0050 ;Load X direct
Indexed, 8-bit offset instructions are 2-byte instructions that can access
data with variable addresses. The CPU adds the unsigned bytes in H:X
to the unsigned byte following the opcode. The sum is the effective
address of the operand.
Indexed, 8-bit offset instructions are useful in selecting the kth element
in an n-element table. The table can begin anywhere and can extend as
far as the address map allows. The k value would typically be in H:X, and
the address of the beginning of the table would be in the byte following
the opcode. Using H:X in this way, this addressing mode is limited to the
first 256 addresses in memory. Tables can be located anywhere in the
address map when H:X is used as the base address, and the byte
following is the offset.
Table 4-5 lists the instructions that use indexed, 8-bit offset addressing.
Indexed, 16-bit offset instructions are 3-byte instructions that can access
data with variable addresses at any location in memory. The CPU adds
the unsigned contents of H:X to the 16-bit unsigned word formed by the
two bytes following the opcode. The sum is the effective address of the
operand. The first byte after the opcode is the most significant byte of the
16-bit offset; the second byte is the least significant byte of the offset.
Indexed, 16-bit offset instructions are useful in selecting the kth element
in an n-element table. The table can begin anywhere and can extend as
far as the address map allows. The k value would typically be in H:X, and
the address of the beginning of the table would be in the bytes following
the opcode.
This example uses the JMP (unconditional jump) instruction to show the
three different types of indexed addressing.
Machine
Label Operation Operand Comments
Code
The stack pointer, 8-bit offset addressing mode permits easy access of
data on the stack. The CPU adds the unsigned byte in the 16-bit stack
pointer (SP) register to the unsigned byte following the opcode. The sum
is the effective address of the operand.
If interrupts are disabled, this addressing mode allows the stack pointer
to be used as a second “index” register. Table 4-6 lists the instructions
that can be used in the stack pointer, 8-bit offset addressing mode.
Examples of the 8-bit and 16-bit offset stack pointer addressing modes
are shown here. The first example stores the value of $20 in location
$10, SP = $10 + $FF = $10F and then decrements that location until
equal to zero. The second example loads the accumulator with the
contents of memory location $250, SP = $250 + $FF = $34F.
Machine
Label Operation Operand Comments
Code
Stack pointer, 16-bit offset instructions are useful in selecting the kth
element in an n-element table. The table can begin anywhere and can
extend anywhere in memory. With this 4-byte instruction, the k value
would typically be in the stack pointer register, and the address of the
beginning of the table is located in the two bytes following the 2-byte
opcode.
4.3.10 Relative
Machine
Label Operation Operand Comments
Code
Machine
Label Operation Operand Comments
Code
* Data movement with accumulator
eliminating the accumulator from the data transfer process reduces the
number of execution cycles from 10 to 5 for similar direct-to-direct
operations (see example). This savings can be substantial for a program
containing numerous register-to-register data transfers.
Machine
Label Operation Operand Comments
Code
* Data movement with accumulator
Machine
Label Operation Operand Comments
Code
ORG $50
PTR_OUT RMB 2 ;Circular buffer
;data out pointer
PTR_IN RMB 2 ;Circular buffer
;data in pointer
TX_B RMB SIZE ;Circular buffer
*
* SCI transmit data register empty interrupt
* service routine
*
ORG $6E00
55 50 TX_INT LDHX PTR_OUT ;Load pointer
B6 16 LDA SCSR1 ;Dummy read of
;SCSR1 as part of
;the TDRE reset
7E 18 MOV X+, SCDR ;Move new byte to
;SCI data reg.
;Clear TDRE. Post
;increment H:X.
65 00 64 CPHX #TX_B + ;Gone past end of
SIZE ;circular buffer?
23 03 BLS NOLOOP ;If not, continue
45 00 54 LDHX #TX_B ;Else reset to
;start of buffer
35 50 NOLOOP STHX PTR_OUT ;Save new
;pointer value
80 RTI ;Return
ORG $70
PTR_OUT RMB 2 ;Circular buffer
;data out pointer
PTR_IN RMB 2 ;Circular buffer
;data in pointer
RX_B RMB SIZE ;Circular buffer
*
* SCI receive data register full interrupt
* service routine
*
Machine
Label Operation Operand Comments
Code
ORG $6E00
55 72 RX_INT LDHX PTR_IN ;Load pointer
B6 16 LDA SCSR1 ;Dummy read of
;SCSR1 as part of
;the RDRF reset
5E 18 MOV SCDR ,X+ ;Move new byte from
;SCI data reg.
;Clear RDRF. Post
;increment H:X.
65 00 64 CPHX #RX_B + ;Gone past end of
SIZE ;circular buffer?
23 03 BLS NOLOOP ;If not continue
45 00 54 LDHX #RX_B ;Else reset to
;start of buffer
35 52 NOLOOP STHX PTR_IN ;Save new
;pointer value
80 RTI ;Return
NOTE: Indexed, 8-bit offset with post increment instructions will increment H if
X is incremented past $FF.
This example uses the CBEQ (compare and branch if equal) instruction
to show the two different indexed with post increment addressing
modes.
Machine
Label Operation Operand Comments
Code
A6FF LDA #$FF ;A = $FF
B710 STA $10 ;LOC $10 = $FF
4E1060 MOV $10,$60 ;LOC $60 = $FF
5F CLRX ;Zero X
* Compare contents of A with contents of location pointed to by
* H:X and branch to TAG when equal
7102 LOOP CBEQ X+,TAG ;No offset
20FC BRA LOOP ;Check next location
5F TAG CLRX ;Zero X
* Compare contents of A with contents of location pointed to by
* H:X + $50 and branch to TG1 when equal
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
ADC #opr8i IMM A9 ii 2
ADC opr8a DIR B9 dd 3
ADC opr16a EXT C9 hh ll 4
ADC oprx16,X IX2 D9 ee ff 4
Add with Carry A ← (A) + (M) + (C) ↕ ↕ – ↕ ↕ ↕
ADC oprx8,X IX1 E9 ff 3
ADC ,X IX F9 2
ADC oprx16,SP SP2 9ED9 ee ff 5
ADC oprx8,SP SP1 9EE9 ff 4
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
ASR opr8a DIR 37 dd 4
ASRA INH 47 1
ASRX C INH 57 1
Arithmetic Shift Right ↕ – – ↕ ↕ ↕
ASR oprx8,X b7 b0 IX1 67 ff 4
ASR ,X IX 77 3
ASR oprx8,SP SP1 9E67 ff 5
BIH rel Branch if IRQ Pin High Branch if IRQ pin = 1 – – – – – – REL 2F rr 3
BIL rel Branch if IRQ Pin Low Branch if IRQ pin = 0 – – – – – – REL 2E rr 3
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
BLS rel Branch if Lower or Same Branch if (C) | (Z) = 1 – – – – – – REL 23 rr 3
DIR (b0) 01 dd rr 5
DIR (b1) 03 dd rr 5
DIR (b2) 05 dd rr 5
Branch if Bit n in Memory DIR (b3) 07 dd rr 5
BRCLR n,opr8a,rel Branch if (Mn) = 0 – – – – – ↕
Clear DIR (b4) 09 dd rr 5
DIR (b5) 0B dd rr 5
DIR (b6) 0D dd rr 5
DIR (b7) 0F dd rr 5
DIR (b0) 00 dd rr 5
DIR (b1) 02 dd rr 5
DIR (b2) 04 dd rr 5
Branch if Bit n in Memory DIR (b3) 06 dd rr 5
BRSET n,opr8a,rel Branch if (Mn) = 1 – – – – – ↕
Set DIR (b4) 08 dd rr 5
DIR (b5) 0A dd rr 5
DIR (b6) 0C dd rr 5
DIR (b7) 0E dd rr 5
DIR (b0) 10 dd 4
DIR (b1) 12 dd 4
DIR (b2) 14 dd 4
DIR (b3) 16 dd 4
BSET n,opr8a Set Bit n in Memory Mn ← 1 – – – – – –
DIR (b4) 18 dd 4
DIR (b5) 1A dd 4
DIR (b6) 1C dd 4
DIR (b7) 1E dd 4
PC ← (PC) + $0002
push (PCL); SP ← (SP) – $0001
BSR rel Branch to Subroutine – – – – – – REL AD rr 4
push (PCH); SP ← (SP) – $0001
PC ← (PC) + rel
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
CLC Clear Carry Bit C←0 – – – – – 0 INH 98 1
Decimal Adjust
DAA Accumulator After ADD or (A)10 U – – ↕ ↕ ↕ INH 72 2
ADC of BCD Values
DBNZ opr8a,rel DIR 3B dd rr 5
DBNZA rel INH 4B rr 3
Decrement A, X, or M
DBNZX rel Decrement and Branch if INH 5B rr 3
Branch if (result) ≠ 0 – – – – – –
DBNZ oprx8,X,rel Not Zero IX1 6B ff rr 5
DBNZX Affects X Not H
DBNZ ,X,rel IX 7B rr 4
DBNZ oprx8,SP,rel SP1 9E6B ff rr 6
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
DEC opr8a M← (M) – $01 DIR 3A dd 4
DECA A← (A) – $01 INH 4A 1
DECX X← (X) – $01 INH 5A 1
Decrement ↕ – – ↕ ↕ –
DEC oprx8,X M← (M) – $01 IX1 6A ff 4
DEC ,X M← (M) – $01 IX 7A 3
DEC oprx8,SP M← (M) – $01 SP1 9E6A ff 5
A ← (H:A)÷(X)
DIV Divide – – – – ↕ ↕ INH 52 7
H ← Remainder
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
LDX #opr8i IMM AE ii 2
LDX opr8a DIR BE dd 3
LDX opr16a EXT CE hh ll 4
LDX oprx16,X Load X (Index Register IX2 DE ee ff 4
X ← (M) 0 – – ↕ ↕ –
LDX oprx8,X Low) from Memory IX1 EE ff 3
LDX ,X IX FE 2
LDX oprx16,SP SP2 9EDE ee ff 5
LDX oprx8,SP SP1 9EEE ff 4
Nibble Swap
NSA A ← (A[3:0]:A[7:4]) – – – – – – INH 62 3
Accumulator
ORA #opr8i IMM AA ii 2
ORA opr8a DIR BA dd 3
ORA opr16a EXT CA hh ll 4
ORA oprx16,X Inclusive OR Accumulator IX2 DA ee ff 4
A ← (A) | (M) 0 – – ↕ ↕ –
ORA oprx8,X and Memory IX1 EA ff 3
ORA ,X IX FA 2
ORA oprx16,SP SP2 9EDA ee ff 5
ORA oprx8,SP SP1 9EEA ff 4
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
Push X (Index Register
PSHX Push (X); SP ← (SP) – $0001 – – – – – – INH 89 2
Low) onto Stack
SP ← $FF
RSP Reset Stack Pointer – – – – – – INH 9C 1
(High Byte Not Affected)
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
STHX opr Store H:X (Index Reg.) (M:M + $0001) ← (H:X) 0 – – ↕ ↕ – DIR 35 dd 4
Enable Interrupts:
Stop Processing
STOP I bit ← 0; Stop Processing – – 0 – – – INH 8E 1
Refer to MCU
Documentation
PC ← (PC) + $0001
Push (PCL); SP ← (SP) – $0001
Push (PCH); SP ← (SP) – $0001
Push (X); SP ← (SP) – $0001
SWI Software Interrupt Push (A); SP ← (SP) – $0001 – – 1 – – – INH 83 9
Push (CCR); SP ← (SP) – $0001
I ← 1;
PCH ← Interrupt Vector High Byte
PCL ← Interrupt Vector Low Byte
Transfer Accumulator to
TAP CCR ← (A) ↕ ↕ ↕ ↕ ↕ ↕ INH 84 2
CCR
Transfer Accumulator to
TAX X ← (A) – – – – – – INH 97 1
X (Index Register Low)
Transfer CCR to
TPA A ← (CCR) – – – – – – INH 85 1
Accumulator
Operand
Address
Effect
Opcode
Cycles
Mode
Source on CCR
Operation Description
Form
V H I N Z C
TXS Transfer Index Reg. to SP SP ← (H:X) – $0001 – – – – – – INH 94 2
Reference Manual
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 4 1 1 4 5 3 2 1 2 3 4 4 5 3 4 2
7 BRCLR3 BCLR3 BEQ ASR ASRA ASRX ASR ASR ASR PSHA TAX AIS STA STA STA STA STA STA STA
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 4 1 1 4 5 3 2 1 2 3 4 4 5 3 4 2
8 BRSET4 BSET4 BHCC LSL LSLA LSLX LSL LSL LSL PULX CLC EOR EOR EOR EOR EOR EOR EOR EOR
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 4 1 1 4 5 3 2 1 2 3 4 4 5 3 4 2
9 BRCLR4 BCLR4 BHCS ROL ROLA ROLX ROL ROL ROL PSHX SEC ADC ADC ADC ADC ADC ADC ADC ADC
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 4 1 1 4 5 3 2 2 2 3 4 4 5 3 4 2
A BRSET5 BSET5 BPL DEC DECA DECX DEC DEC DEC PULH CLI ORA ORA ORA ORA ORA ORA ORA ORA
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 5 3 3 5 6 4 2 2 2 3 4 4 5 3 4 2
B BRCLR5 BCLR5 BMI DBNZ DBNZA DBNZX DBNZ DBNZ DBNZ PSHH SEI ADD ADD ADD ADD ADD ADD ADD ADD
3 DIR 2 DIR 2 REL 3 DIR 2 INH 2 INH 3 IX1 4 SP1 2 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 4 1 1 4 5 3 1 1 2 3 4 3 2
C BRSET6 BSET6 BMC INC INCA INCX INC INC INC CLRH RSP JMP JMP JMP JMP JMP
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 4 3 3 1 1 3 4 2 1 4 4 5 6 5 4
D BRCLR6 BCLR6 BMS TST TSTA TSTX TST TST TST NOP BSR JSR JSR JSR JSR JSR
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 2 REL 2 DIR 3 EXT 3 IX2 2 IX1 1 IX
5 4 3 5 4 4 4 1 2 3 4 4 5 3 4 2
E BRSET7 BSET7 BIL MOV MOV MOV MOV STOP * LDX LDX LDX LDX LDX LDX LDX LDX
3 DIR 2 DIR 2 REL 3 DD 2 DIX+ 3 IMD 2 IX+D 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
5 4 3 3 1 1 3 4 2 1 1 2 3 4 4 5 3 4 2
F BRCLR7 BCLR7 BIH CLR CLRA CLRX CLR CLR CLR WAIT TXA AIX STX STX STX STX STX STX STX
3 DIR 2 DIR 2 REL 2 DIR 1 INH 1 INH 2 IX1 3 SP1 1 IX 1 INH 1 INH 2 IMM 2 DIR 3 EXT 3 IX2 4 SP2 2 IX1 3 SP1 1 IX
CPU08 — Rev. 3.0
IX+D Indexed-Direct DIX+ Direct-Indexed Post Increment Low Byte of Opcode in Hexadecimal 0 SUB Opcode Mnemonic
*Pre-byte for stack pointer indexed instructions 1 IX Number of Bytes / Addressing Mode
Reference Manual — CPU08
5.1 Contents
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
5.2 Introduction
This section contains detailed information for all HC08 Family
instructions. The instructions are arranged in alphabetical order with the
instruction mnemonic set in larger type for easy reference.
5.3 Nomenclature
This nomenclature is used in the instruction descriptions throughout this
section.
Operators
() = Contents of register or memory location shown inside
parentheses
← = Is loaded with (read: “gets”)
& = Boolean AND
| = Boolean OR
⊕ = Boolean exclusive-OR
× = Multiply
÷ = Divide
: = Concatenate
+ = Add
– = Negate (two’s complement)
« = Sign extend
CPU registers
A = Accumulator
CCR = Condition code register
H = Index register, higher order (most significant) eight bits
X = Index register, lower order (least significant) eight bits
PC = Program counter
PCH = Program counter, higher order (most significant) eight
bits
PCL = Program counter, lower order (least significant) eight
bits
SP = Stack pointer
Source forms
Typically, assemblers are flexible about the use of spaces and tabs.
Often, any number of spaces or tabs can be used where a single space
is shown on the glossary pages. Spaces and tabs are also normally
allowed before and after commas. When program labels are used, there
must also be at least one tab or space before all instruction mnemonics.
This required space is not apparent in the source forms.
a literal expression. All commas, pound signs (#), parentheses, and plus
signs (+) are literal characters.
Address modes
INH = Inherent (no operands)
IMM = 8-bit or 16-bit immediate
DIR = 8-bit direct
EXT = 16-bit extended
IX = 16-bit indexed no offset
IX+ = 16-bit indexed no offset, post increment (CBEQ and
MOV only)
IX1 = 16-bit indexed with 8-bit offset from H:X
IX1+ = 16-bit indexed with 8-bit offset, post increment
(CBEQ only)
IX2 = 16-bit indexed with 16-bit offset from H:X
REL = 8-bit relative offset
SP1 = Stack pointer relative with 8-bit offset
SP2 = Stack pointer relative with 16-bit offset
Description Adds the contents of the C bit to the sum of the contents of A and M and
places the result in A. This operation is useful for addition of operands
that are larger than eight bits.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 ↕ — ↕ ↕ ↕
Formulae
V: A7&M7&R7 | A7&M7&R7
Set if a two’s compement overflow resulted from the operation;
cleared otherwise
H: A3&M3 | M3&R3 | R3&A3
Set if there was a carry from bit 3; cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: A7&M7 | M7&R7 | R7&A7
Set if there was a carry from the most significant bit (MSB) of the
result; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ADC #opr8i IMM A9 ii 2
Code, Cycles, and
ADC opr8a DIR B9 dd 3
Access Details
ADC opr16a EXT C9 hh ll 4
ADC oprx16,X IX2 D9 ee ff 4
ADC oprx8,X IX1 E9 ff 3
ADC ,X IX F9 2
ADC oprx16,SP SP2 9ED9 ee ff 5
ADC oprx8,SP SP1 9EE9 ff 4
Description Adds the contents of M to the contents of A and places the result in A
Condition Codes :
V H I N Z C
and Boolean
↕ 1 1 ↕ — ↕ ↕ ↕
Formulae
V: A7&M7&R7 | A7&M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise
H: A3&M3 | M3&R3 | R3&A3
Set if there was a carry from bit 3; cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: A7&M7 | M7&R7 | R7&A7
Set if there was a carry from the MSB of the result; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ADD #opr8i IMM AB ii 2
Code, Cycles, and
ADD opr8a DIR BB dd 3
Access Details
ADD opr16a EXT CB hh ll 4
ADD oprx16,X IX2 DB ee ff 4
ADD oprx8,X IX1 EB ff 3
ADD ,X IX FB 2
ADD oprx16,SP SP2 9EDB ee ff 5
ADD oprx8,SP SP1 9EEB ff 4
Description Adds the immediate operand to the stack pointer (SP). The immediate
value is an 8-bit two’s complement signed operand. The 8-bit operand is
sign-extended to 16 bits prior to the addition. The AIS instruction can be
used to create and remove a stack frame buffer that is used to store
temporary variables.
This instruction does not affect any condition code bits so status
information can be passed to or from a subroutine or C function and
allocation or deallocation of space for local variables will not disturb that
status information.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
AIS #opr8i IMM A7 ii 2
Cycle, and Access
Detail
Description Adds an immediate operand to the 16-bit index register, formed by the
concatenation of the H and X registers. The immediate operand is an
8-bit two’s complement signed offset. The 8-bit operand is sign-
extended to 16 bits prior to the addition.
This instruction does not affect any condition code bits so index register
pointer calculations do not disturb the surrounding code which may rely
on the state of CCR status bits.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
AIX #opr8i IMM AF ii 2
Cycles, and
Access Detail
Description Performs the logical AND between the contents of A and the contents of
M and places the result in A. Each bit of A after the operation will be the
logical AND of the corresponding bits of M and of A before the operation.
Condition Codes :
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
AND #opr8i IMM A4 ii 2
Code, Cycles, and
AND opr8a DIR B4 dd 3
Access Details
AND opr16a EXT C4 hh ll 4
AND oprx16,X IX2 D4 ee ff 4
AND oprx8,X IX1 E4 ff 3
AND ,X IX F4 2
AND oprx16,SP SP2 9ED4 ee ff 5
AND oprx8,SP SP1 9EE4 ff 4
Operation
C b7 — — — — — — b0 0
Description Shifts all bits of A, X, or M one place to the left. Bit 0 is loaded with a 0.
The C bit in the CCR is loaded from the most significant bit of A, X, or M.
This is mathematically equivalent to multiplication by two. The V bit
indicates whether the sign of the result has changed.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: R7⊕b7
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b7
Set if, before the shift, the MSB of A, X, or M was set; cleared
otherwise
Source Forms,
Addressing Source Addr Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ASL opr8a DIR 38 dd 4
Code, Cycles, and
ASLA INH (A) 48 1
Access Details
ASLX INH (X) 58 1
ASL oprx8,X IX1 68 ff 4
ASL ,X IX 78 3
ASL oprx8,SP SP1 9E68 ff 5
b7 — — — — — — — b0 C
Description Shifts all bits of A, X, or M one place to the right. Bit 7 is held constant.
Bit 0 is loaded into the C bit of the CCR. This operation effectively divides
a two’s complement value by 2 without changing its sign. The carry bit
can be used to round the result.
Condition Codes :
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: R7⊕b0
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b0
Set if, before the shift, the LSB of A, X, or M was set; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ASR opr8a DIR 37 dd 4
Code, Cycles, and
ASRA INH (A) 47 1
Access Details
ASRX INH (X) 57 1
ASR oprx8,X IX1 67 ff 4
ASR ,X IX 77 3
ASR oprx8,SP SP1 9E67 ff 5
Simple branch
Description Tests state of C bit in CCR and causes a branch if C is clear. BCC can
be used after shift or rotate instructions or to check for overflow after
operations on unsigned numbers. See the BRA instruction for further
details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BCC rel REL 24 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
BCLR 0,opr8a DIR (b0) 11 dd 4
Code, Cycles, and
BCLR 1,opr8a DIR (b1) 13 dd 4
Access Details
BCLR 2,opr8a DIR (b2) 15 dd 4
BCLR 3,opr8a DIR (b3) 17 dd 4
BCLR 4,opr8a DIR (b4) 19 dd 4
BCLR 5,opr8a DIR (b5) 1B dd 4
BCLR 6,opr8a DIR (b6) 1D dd 4
BCLR 7,opr8a DIR (b7) 1F dd 4
Simple branch
Description Tests the state of the C bit in the CCR and causes a branch if C is set.
BCS can be used after shift or rotate instructions or to check for overflow
after operations on unsigned numbers. See the BRA instruction for
further details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BCS rel REL 25 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the Z bit in the CCR and causes a branch if Z is set.
Compare instructions perform a subtraction with two operands and
produce an internal result without changing the original operands. If the
two operands were equal, the internal result of the subtraction for the
compare will be zero so the Z bit will be equal to one and the BEQ will
cause a branch.
This instruction can also be used after a load or store without having to
do a separate test or compare on the loaded value. See the BRA
instruction for further details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BEQ rel REL 27 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Formulae — 1 1 — — — — —
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BGE rel REL 90 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BGT rel REL 92 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the H bit in the CCR and causes a branch if H is clear.
This instruction is used in algorithms involving BCD numbers that were
originally written for the M68HC05 or M68HC08 devices. The DAA
instruction in the HC08 simplifies operations on BCD numbers so BHCC
and BHCS should not be needed in new programs. See the BRA
instruction for further details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BHCC rel REL 28 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the H bit in the CCR and causes a branch if H is set.
This instruction is used in algorithms involving BCD numbers that were
originally written for the M68HC05 or M68HC08 devices. The DAA
instruction in the HC08 simplifies operations on BCD numbers so BHCC
and BHCS should not be needed in new programs. See the BRA
instruction for further details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BHCS rel REL 29 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Causes a branch if both C and Z are cleared. If the BHI instruction is
executed immediately after execution of a CMP, CPHX, CPX, SBC, or
SUB instruction, the branch will occur if the unsigned binary number in
the A, X, or H:X register was greater than unsigned binary number in
memory. Generally not useful after CLR, COM, DEC, INC, LDA, LDHX,
LDX, STA, STHX, STX, or TST because these instructions do not affect
the carry bit in the CCR. See the BRA instruction for details of the
execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BHI rel REL 22 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BHS rel REL 24 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the external interrupt pin and causes a branch if the
pin is high. See the BRA instruction for further details of the execution of
the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BIH rel REL 2F rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the external interrupt pin and causes a branch if the
pin is low. See the BRA instruction for further details of the execution of
the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BIL rel REL 2E rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Performs the logical AND comparison of the contents of A and the
contents of M and modifies the condition codes accordingly. Neither the
contents of A nor M are altered. (Each bit of the result of the AND would
be the logical AND of the corresponding bits of A and M.)
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
BIT #opr8i IMM A5 ii 2
Code, Cycles, and
BIT opr8a DIR B5 dd 3
Access Details
BIT opr16a EXT C5 hh ll 4
BIT oprx16,X IX2 D5 ee ff 4
BIT oprx8,X IX1 E5 ff 3
BIT ,X IX F5 2
BIT oprx16,SP SP2 9ED5 ee ff 5
BIT oprx8,SP SP1 9EE5 ff 4
Formulae — 1 1 — — — — —
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BLE rel REL 93 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Formulae — 1 1 — — — — —
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BLO rel REL 25 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Formulae — 1 1 — — — — —
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BLS rel REL 23 rr 3
Cycle, and Access
Detail See the BRA instruction for a summary of all branches and their
complements.
Formulae — 1 1 — — — — —
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BLT rel REL 91 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the I bit in the CCR and causes a branch if I is clear (if
interrupts are enabled). See the BRA instruction for further details of the
execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BMC rel REL 2C rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the N bit in the CCR and causes a branch if N is set.
Simply loading or storing A, X, or H:X will cause the N condition code bit
to be set or cleared to match the most significant bit of the value loaded
or stored. The BMI instruction can be used after such a load or store
without having to do a separate test or compare instruction before the
conditional branch. See the BRA instruction for further details of the
execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BMI rel REL 2B rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the I bit in the CCR and causes a branch if I is set (if
interrupts are disabled). See BRA instruction for further details of the
execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BMS rel REL 2D rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Description Tests the state of the Z bit in the CCR and causes a branch if Z is clear
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BNE rel REL 26 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Simple branch
Description Tests the state of the N bit in the CCR and causes a branch if N is clear
Simply loading or storing A, X, or H:X will cause the N condition code bit
to be set or cleared to match the most significant bit of the value loaded
or stored. The BPL instruction can be used after such a load or store
without having to do a separate test or compare instruction before the
conditional branch. See the BRA instruction for further details of the
execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BPL rel REL 2A rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BRA rel REL 20 rr 3
Cycles, and
Access Detail The table on the facing page is a summary of all branch instructions.
The C bit is set to the state of the tested bit. When used with an
appropriate rotate instruction, BRCLR n provides an easy method for
performing serial-to-parallel conversions.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — — ↕
Formulae
C: Set if Mn = 1; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
BRCLR 0,opr8a,rel DIR (b0) 01 dd rr 5
Code, Cycles, and
BRCLR 1,opr8a,rel DIR (b1) 03 dd rr 5
Access Details
BRCLR 2,opr8a,rel DIR (b2) 05 dd rr 5
BRCLR 3,opr8a,rel DIR (b3) 07 dd rr 5
BRCLR 4,opr8a,rel DIR (b4) 09 dd rr 5
BRCLR 5,opr8a,rel DIR (b5) 0B dd rr 5
BRCLR 6,opr8a,rel DIR (b6) 0D dd rr 5
BRCLR 7,opr8a,rel DIR (b7) 0F dd rr 5
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — — —
Formulae
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BRN rel REL 21 rr 3
Cycles, and
Access Detail See the BRA instruction for a summary of all branches and their
complements.
The C bit is set to the state of the tested bit. When used with an
appropriate rotate instruction, BRSET n provides an easy method for
performing serial-to-parallel conversions.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — — ↕
Formulae
C: Set if Mn = 1; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
BRSET 0,opr8a,rel DIR (b0) 00 dd rr 5
Code, Cycles, and
BRSET 1,opr8a,rel DIR (b1) 02 dd rr 5
Access Details
BRSET 2,opr8a,rel DIR (b2) 04 dd rr 5
BRSET 3,opr8a,rel DIR (b3) 06 dd rr 5
BRSET 4,opr8a,rel DIR (b4) 08 dd rr 5
BRSET 5,opr8a,rel DIR (b5) 0A dd rr 5
BRSET 6,opr8a,rel DIR (b6) 0C dd rr 5
BRSET 7,opr8a,rel DIR (b7) 0E dd rr 5
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
BSET 0,opr8a DIR (b0) 10 dd 4
Code, Cycles, and
BSET 1,opr8a DIR (b1) 12 dd 4
Access Details
BSET 2,opr8a DIR (b2) 14 dd 4
BSET 3,opr8a DIR (b3) 16 dd 4
BSET 4,opr8a DIR (b4) 18 dd 4
BSET 5,opr8a DIR (b5) 1A dd 4
BSET 6,opr8a DIR (b6) 1C dd 4
BSET 7,opr8a DIR (b7) 1E dd 4
Description The program counter is incremented by 2 from the opcode address (so
it points to the opcode of the next instruction which will be the return
address). The least significant byte of the contents of the program
counter (low-order return address) is pushed onto the stack. The stack
pointer is then decremented by 1. The most significant byte of the
contents of the program counter (high-order return address) is pushed
onto the stack. The stack pointer is then decremented by 1. A branch
then occurs to the location specified by the branch offset. See the BRA
instruction for further details of the execution of the branch.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
BSR rel REL AD rr 4
Cycles, and
Access Detail
Description CBEQ compares the operand with the accumulator (or index register for
CBEQX instruction) against the contents of a memory location and
causes a branch if the register (A or X) is equal to the memory contents.
The CBEQ instruction combines CMP and BEQ for faster table lookup
routines and condition codes are not changed.
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
CBEQ opr8a,rel DIR 31 dd rr 5
Code, Cycles, and
CBEQA #opr8i,rel IMM 41 ii rr 4
Access Details
CBEQX #opr8i,rel IMM 51 ii rr 4
CBEQ oprx8,X+,rel IX1+ 61 ff rr 5
CBEQ ,X+,rel IX+ 71 rr 4
CBEQ oprx8,SP,rel SP1 9E61 ff rr 6
Description Clears the C bit in the CCR. CLC may be used to set up the C bit prior
to a shift or rotate instruction that involves the C bit. The C bit can also
be used to pass status information between a subroutine and the calling
program.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — — 0
Formulae
C: 0
Cleared
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
CLC INH 98 1
Cycles, and
Access Detail
Description Clears the interrupt mask bit in the CCR. When the I bit is clear,
interrupts are enabled. The I bit actually changes to zero at the end of
the cycle where the CLI instruction executes. This is too late to recognize
an interrupt that arrived before or during the CLI instruction so if
interrupts were previously disabled, the next instruction after a CLI will
always be executed even if there was an interrupt pending prior to
execution of the CLI instruction.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — 0 — — —
Formulae
I: 0
Cleared
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
CLI INH 9A 2
Cycles, and
Access Detail
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — 0 1 —
Formulae
V: 0
Cleared
N: 0
Cleared
Z: 1
Set
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
CLR opr8a DIR 3F dd 3
Code, Cycles, and
CLRA INH (A) 4F 1
Access Details
CLRX INH (X) 5F 1
CLRH INH (H) 8C 1
CLR oprx8,X IX1 6F ff 3
CLR ,X IX 7F 2
CLR oprx8,SP SP1 9E6F ff 4
Description Compares the contents of A to the contents of M and sets the condition
codes, which may then be used for arithmetic (signed or unsigned) and
logical conditional branching. The contents of both A and M are
unchanged.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: A7&M7&R7 | A7&M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise. Literally read, an overflow condition occurs if
a positive number is subtracted from a negative number with a
positive result, or, if a negative number is subtracted from a
positive number with a negative result.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: A7&M7 | M7&R7 | R7&A7
Set if the unsigned value of the contents of memory is larger than
the unsigned value of the accumulator; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
CMP #opr8i IMM A1 ii 2
Code, Cycles, and
CMP opr8a DIR B1 dd 3
Access Details
CMP opr16a EXT C1 hh ll 4
CMP oprx16,X IX2 D1 ee ff 4
CMP oprx8,X IX1 E1 ff 3
CMP ,X IX F1 2
CMP oprx16,SP SP2 9ED1 ee ff 5
CMP oprx8,SP SP1 9EE1 ff 4
Description Replaces the contents of A, X, or M with the one’s complement. Each bit
of A, X, or M is replaced with the complement of that bit.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ 1
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: 1
Set
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
COM opr8a DIR 33 dd 4
Code, Cycles, and
COMA INH (A) 43 1
Access Details
COMX INH (X) 53 1
COM oprx8,X IX1 63 ff 4
COM ,X IX 73 3
COM oprx8,SP SP1 9E63 ff 5
Description CPHX compares index register (H:X) with the 16-bit value in memory
and sets the condition codes, which may then be used for arithmetic
(signed or unsigned) and logical conditional branching. The contents of
both H:X and M:M + $0001 are unchanged.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: H7&M15&R15 | H7&M15&R15
Set if a two’s complement overflow resulted from the operation;
cleared otherwise
N: R15
Set if MSB of result is 1; cleared otherwise
Z: R15&R14&R13&R12&R11&R10&R9&R8
&R7&R6&R5&R4&R3&R2&R1&R0
Set if the result is $0000; cleared otherwise
C: H7&M15 | M15&R15 | R15&H7
Set if the absolute value of the contents of memory is larger than the
absolute value of the index register; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
CPHX #opr IMM 65 jj kk+1 3
Code, Cycles, and
CPHX opr DIR 75 dd 4
Access Details
Description Compares the contents of X to the contents of M and sets the condition
codes, which may then be used for arithmetic (signed or unsigned) and
logical conditional branching. The contents of both X and M are
unchanged.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: X7&M7&R7 | X7&M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise
N: R7
Set if MSB of result of the subtraction is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: X7&M7 | M7&R7 | R7&X7
Set if the unsigned value of the contents of memory is
larger than the unsigned value in the index register;
cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
CPX #opr8i IMM A3 ii 2
Code, Cycles, and
CPX opr8a DIR B3 dd 3
Access Details
CPX opr16a EXT C3 hh ll 4
CPX oprx16,X IX2 D3 ee ff 4
CPX oprx8,X IX1 E3 ff 3
CPX ,X IX F3 2
CPX oprx16,SP SP2 9ED3 ee ff 5
CPX oprx8,SP SP1 9EE3 ff 4
Description Adjusts the contents of the accumulator and the state of the CCR carry
bit after an ADD or ADC operation involving binary-coded decimal (BCD)
values, so that there is a correct BCD sum and an accurate carry
indication. The state of the CCR half carry bit affects operation. Refer to
Table 5-2 for details of operation.
Condition Codes
V H I N Z C
and Boolean
U 1 1 — — ↕ ↕ ↕
Formulae
V: U
Undefined
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: Set if the decimal adjusted result is greater than 99 (decimal);
refer to Table 5-2
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
DAA INH 72 2
Cycles, and
Access Detail
Description Subtract 1 from the contents of A, M, or X; then branch using the relative
offset if the result of the subtraction is not $00. DBNZX only affects the
low order eight bits of the H:X index register pair; the high-order byte (H)
is not affected.
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
DBNZ opr8a,rel DIR 3B dd rr 5
Code, Cycles, and
DBNZA rel INH 4B rr 3
Access Details
DBNZX rel INH 5B rr 3
DBNZ oprx8,X,rel IX1 6B ff rr 5
DBNZ ,X, rel IX 7B rr 4
DBNZ oprx8,SP,rel SP1 9E6B ff rr 6
DECX only affects the low-order byte of index register pair (H:X). To
decrement the full 16-bit index register pair (H:X), use AIX # –1.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ —
Formulae
V: R7 & A7
Set if there was a two’s complement overflow as a result of the
operation; cleared otherwise. Two’s complement overflow occurs
if and only if (A), (X), or (M) was $80 before the operation.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
DEC opr8a DIR 3A dd 4
Code, Cycles, and
DECA INH (A) 4A 1
Access Details
DECX INH (X) 5A 1
DEC oprx8,X IX1 6A ff 4
DEC ,X IX 7A 3
DEC oprx8,SP SP1 9E6A ff 5
DEX is recognized by assemblers as being equivalent to DECX.
An overflow (quotient > $FF) or divide-by-0 sets the C bit, and the
quotient and remainder are indeterminate.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — ↕ ↕
Formulae
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result (quotient) is $00; cleared otherwise
C: Set if a divide-by-0 was attempted or if an overflow occurred;
cleared otherwise
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
DIV INH 52 7
Cycles, and
Access Detail
Description Performs the logical exclusive-OR between the contents of A and the
contents of M and places the result in A. Each bit of A after the operation
will be the logical exclusive-OR of the corresponding bits of M and A
before the operation.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
EOR #opr8i IMM A8 ii 2
Code, Cycles, and
EOR opr8a DIR B8 dd 3
Access Details
EOR opr16a EXT C8 hh ll 4
EOR oprx16,X IX2 D8 ee ff 4
EOR oprx8,X IX1 E8 ff 3
EOR ,X IX F8 2
EOR oprx16,SP SP2 9ED8 ee ff 5
EOR oprx8,SP SP1 9EE8 ff 4
Description Add 1 to the contents of A, X, or M. The V, N, and Z bits in the CCR are
set or cleared according to the results of this operation. The C bit in the
CCR is not affected; therefore, the BLS, BLO, BHS, and BHI branch
instructions are not useful following an INC instruction.
INCX only affects the low-order byte of index register pair (H:X). To
increment the full 16-bit index register pair (H:X), use AIX #1.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ —
Formulae
V: A7&R7
Set if there was a two’s complement overflow as a result of the
operation; cleared otherwise. Two’s complement overflow occurs
if and only if (A), (X), or (M) was $7F before the operation.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
INC opr8a DIR 3C dd 4
Code, Cycles, and
INCA INH (A) 4C 1
Access Details
INCX INH (X) 5C 1
INC oprx8,X IX1 6C ff 4
INC ,X IX 7C 3
INC oprx8,SP SP1 9E6C ff 5
INX is recognized by assemblers as being equivalent to INCX.
Description A jump occurs to the instruction stored at the effective address. The
effective address is obtained according to the rules for extended, direct,
or indexed addressing.
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
JMP opr8a DIR BC dd 2
Code, Cycles, and
JMP opr16a EXT CC hh ll 3
Access Details
JMP oprx16,X IX2 DC ee ff 4
JMP oprx8,X IX1 EC ff 3
JMP ,X IX FC 3
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
JSR opr8a DIR BD dd 4
Code, Cycles, and
JSR opr16a EXT CD hh ll 5
Access Details
JSR oprx16,X IX2 DD ee ff 6
JSR oprx8,X IX1 ED ff 5
JSR ,X IX FD 4
Description Loads the contents of the specified memory location into A. The N and
Z condition codes are set or cleared according to the loaded data; V is
cleared. This allows conditional branching after the load without having
to perform a separate test or compare.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
LDA #opr8i IMM A6 ii 2
Code, Cycles, and
LDA opr8a DIR B6 dd 3
Access Details
LDA opr16a EXT C6 hh ll 4
LDA oprx16,X IX2 D6 ee ff 4
LDA oprx8,X IX1 E6 ff 3
LDA ,X IX F6 2
LDA oprx16,SP SP2 9ED6 ee ff 5
LDA oprx8,SP SP1 9EE6 ff 4
Description Loads the contents of the specified memory location into the index
register (H:X). The N and Z condition codes are set according to the
data; V is cleared. This allows conditional branching after the load
without having to perform a separate test or compare.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R15
Set if MSB of result is 1; cleared otherwise
Z: R15&R14&R13&R12&R11&R10&R9&R8
&R7&R6&R5&R4&R3&R2&R1&R0
Set if the result is $0000; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
LDHX #opr IMM 45 jj kk 3
Code, Cycles, and
LDHX opr DIR 55 dd 4
Access Details
Description Loads the contents of the specified memory location into X. The N and
Z condition codes are set or cleared according to the loaded data; V is
cleared. This allows conditional branching after the load without having
to perform a separate test or compare.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
LDX #opr8i IMM AE ii 2
Code, Cycles, and
LDX opr8a DIR BE dd 3
Access Details
LDX opr16a EXT CE hh ll 4
LDX oprx16,X IX2 DE ee ff 4
LDX oprx8,X IX1 EE ff 3
LDX ,X IX FE 2
LDX oprx16,SP SP2 9EDE ee ff 5
LDX oprx8,SP SP1 9EEE ff 4
Operation
C b7 — — — — — — b0 0
Description Shifts all bits of the A, X, or M one place to the left. Bit 0 is loaded with
a 0. The C bit in the CCR is loaded from the most significant bit of A, X,
or M.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: R7⊕b7
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b7
Set if, before the shift, the MSB of A, X, or M was set; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
LSL opr8a DIR 38 dd 4
Code, Cycles, and
LSLA INH (A) 48 1
Access Details
LSLX INH (X) 58 1
LSL oprx8,X IX1 68 ff 4
LSL ,X IX 78 3
LSL oprx8,SP SP1 9E68 ff 5
0 b7 — — — — — — b0 C
Description Shifts all bits of A, X, or M one place to the right. Bit 7 is loaded with
a 0. Bit 0 is shifted into the C bit.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — 0 ↕ ↕
Formulae
V: 0⊕b0 = b0
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise. Since N = 0, this simplifies to the value of bit 0
before the shift.
N: 0
Cleared
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b0
Set if, before the shift, the LSB of A, X, or M, was set; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
LSR opr8a DIR 34 dd 4
Code, Cycles, and
LSRA INH (A) 44 1
Access Details
LSRX INH (X) 54 1
LSR oprx8,X IX1 64 ff 4
LSR ,X IX 74 3
LSR oprx8,SP SP1 9E64 ff 5
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is set; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
MOV opr8a,opr8a DIR/DIR 4E dd dd 5
Code, Cycles, and
MOV opr8a,X+ DIR/IX+ 5E dd 4
Access Details
MOV #opr8i,opr8a IMM/DIR 6E ii dd 4
MOV ,X+,opr8a IX+/DIR 7E dd 4
Description Multiplies the 8-bit value in X (index register low) by the 8-bit value in the
accumulator to obtain a 16-bit unsigned result in the concatenated index
register and accumulator. After the operation, X contains the upper eight
bits of the 16-bit result and A contains the lower eight bits of the result.
Condition Codes
V H I N Z C
and Boolean
— 1 1 0 — — — 0
Formulae
H: 0
Cleared
C: 0
Cleared
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
MUL INH 42 5
Cycles, and
Access Detail
Description Replaces the contents of A, X, or M with its two’s complement. Note that
the value $80 is left unchanged.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise. Overflow will occur only if the operand is $80
before the operation.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: R7|R6|R5|R4|R3|R2|R1|R0
Set if there is a borrow in the implied subtraction from 0; cleared
otherwise. The C bit will be set in all cases except when the
contents of A, X, or M was $00 prior to the NEG operation.
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
NEG opr8a DIR 30 dd 4
Code, Cycles, and
NEGA INH (A) 40 1
Access Details
NEGX INH (X) 50 1
NEG oprx8,X IX1 60 ff 4
NEG ,X IX 70 3
NEG oprx8,SP SP1 9E60 ff 5
Description This is a single-byte instruction that does nothing except to consume one
CPU clock cycle while the program counter is advanced to the next
instruction. No register or memory contents are affected by this
instruction.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
NOP INH 9D 1
Cycles, and
Access Detail
Description Swaps upper and lower nibbles (4 bits) of the accumulator. The NSA
instruction is used for more efficient storage and use of binary-coded
decimal operands.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
NSA INH 62 3
Cycles, and
Access Detail
Description Performs the logical inclusive-OR between the contents of A and the
contents of M and places the result in A. Each bit of A after the operation
will be the logical inclusive-OR of the corresponding bits of M and A
before the operation.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ORA #opr8i IMM AA ii 2
Code, Cycles, and
ORA opr8a DIR BA dd 3
Access Details
ORA opr16a EXT CA hh ll 4
ORA oprx16,X IX2 DA ee ff 4
ORA oprx8,X IX1 EA ff 3
ORA ,X IX FA 2
ORA oprx16,SP SP2 9EDA ee ff 5
ORA oprx8,SP SP1 9EEA ff 4
Description The contents of A are pushed onto the stack at the address contained in
the stack pointer. The stack pointer is then decremented to point to the
next available location in the stack. The contents of A remain
unchanged.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PSHA INH 87 2
Cycles, and
Access Detail
Description The contents of H are pushed onto the stack at the address contained in
the stack pointer. The stack pointer is then decremented to point to the
next available location in the stack. The contents of H remain
unchanged.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PSHH INH 8B 2
Cycles, and
Access Detail
Description The contents of X are pushed onto the stack at the address contained in
the stack pointer (SP). SP is then decremented to point to the next
available location in the stack. The contents of X remain unchanged.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PSHX INH 89 2
Cycles, and
Access Detail
Description The stack pointer (SP) is incremented to address the last operand on the
stack. The accumulator is then loaded with the contents of the address
pointed to by SP.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PULA INH 86 2
Cycles, and
Access Detail
Description The stack pointer (SP) is incremented to address the last operand on the
stack. H is then loaded with the contents of the address pointed to by SP.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PULH INH 8A 2
Cycles, and
Access Detail
Description The stack pointer (SP) is incremented to address the last operand on the
stack. X is then loaded with the contents of the address pointed to by SP.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
PULX INH 88 2
Cycles, and
Access Detail
C b7 — — — — — — — b0
Description Shifts all bits of A, X, or M one place to the left. Bit 0 is loaded from the
C bit. The C bit is loaded from the most significant bit of A, X, or M. The
rotate instructions include the carry bit to allow extension of the shift and
rotate instructions to multiple bytes. For example, to shift a 24-bit value
left one bit, the sequence (ASL LOW, ROL MID, ROL HIGH) could be
used, where LOW, MID, and HIGH refer to the low-order, middle, and
high-order bytes of the 24-bit value, respectively.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: R7 ⊕ b7
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b7
Set if, before the rotate, the MSB of A, X, or M was set; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ROL opr8a DIR 39 dd 4
Code, Cycles, and
ROLA INH (A) 49 1
Access Details
ROLX INH (X) 59 1
ROL oprx8,X IX1 69 ff 4
ROL ,X IX 79 3
ROL oprx8,SP SP1 9E69 ff 5
b7 — — — — — — — b0 C
Description Shifts all bits of A, X, or M one place to the right. Bit 7 is loaded from the
C bit. Bit 0 is shifted into the C bit. The rotate instructions include the
carry bit to allow extension of the shift and rotate instructions to multiple
bytes. For example, to shift a 24-bit value right one bit, the sequence
(LSR HIGH, ROR MID, ROR LOW) could be used, where LOW, MID,
and HIGH refer to the low-order, middle, and high-order bytes of the
24-bit value, respectively.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: R7 ⊕ b0
Set if the exclusive-OR of the resulting N and C flags is 1;
cleared otherwise
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: b0
Set if, before the shift, the LSB of A, X, or M was set; cleared
otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
ROR opr8a DIR 36 dd 4
Code, Cycles, and
RORA INH (A) 46 1
Access Details
RORX INH (X) 56 1
ROR oprx8,X IX1 66 ff 4
ROR ,X IX 76 3
ROR oprx8,SP SP1 9E66 ff 5
Description In most M68HC05 MCUs, RAM only goes to $00FF. In most HC08s,
however, RAM extends beyond $00FF. Therefore, do not locate the
stack in direct address space which is more valuable for commonly
accessed variables. In new HC08 programs, it is more appropriate to
initialize the stack pointer to the address of the last location (highest
address) in the on-chip RAM, shortly after reset. This code segment
demonstrates a typical method for initializing SP.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
RSP INH 9C 1
Cycles, and
Access Detail
Description The condition codes, the accumulator, X (index register low), and the
program counter are restored to the state previously saved on the stack.
The I bit will be cleared if the corresponding bit stored on the stack is 0,
the normal case.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 ↕ ↕ ↕ ↕ ↕
Formulae
Set or cleared according to the byte pulled from the stack into CCR.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
RTI INH 80 7
Cycles, and
Access Detail
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
RTS INH 81 4
Cycles, and
Access Detail
Description Subtracts the contents of M and the contents of the C bit of the CCR from
the contents of A and places the result in A. This is useful for
multi-precision subtract algorithms involving operands with more than
eight bits.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: A7&M7&R7 | A7&M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise. Literally read, an overflow condition occurs if
a positive number is subtracted from a negative number with a
positive result, or, if a negative number is subtracted from a
positive number with a negative result.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: A7&M7 | M7&R7 | R7&A7
Set if the unsigned value of the contents of memory plus the
previous carry are larger than the unsigned value of the
accumulator; cleared otherwise
Source Forms,
Source Address Machine Code HC08
Addressing Form Mode Cycles
Opcode Operand(s)
Modes, Machine
SBC #opr8i IMM A2 ii 2
Code, Cycles, and
SBC opr8a DIR B2 dd 3
Access Details
SBC opr16a EXT C2 hh ll 4
SBC oprx16,X IX2 D2 ee ff 4
SBC oprx8,X IX1 E2 ff 3
SBC ,X IX F2 2
SBC oprx16,SP SP2 9ED2 ee ff 5
SBC oprx8,SP SP1 9EE2 ff 4
Description Sets the C bit in the condition code register (CCR). SEC may be used to
set up the C bit prior to a shift or rotate instruction that involves the C bit.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — — — — 1
Formulae
C: 1
Set
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
SEC INH 99 1
Cycles, and
Access Detail
Description Sets the interrupt mask bit in the condition code register (CCR). The
microprocessor is inhibited from responding to interrupts while the I bit is
set. The I bit actually changes at the end of the cycle where SEI
executed. This is too late to stop an interrupt that arrived during
execution of the SEI instruction so it is possible that an interrupt request
could be serviced after the SEI instruction before the next instruction
after SEI is executed. The global I-bit interrupt mask takes effect before
the next instruction can be completed.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — 1 — — —
Formulae
I: 1
Set
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
SEI INH 9B 2
Cycles, and
Access Detail
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: A7
Set if MSB of result is 1; cleared otherwise
Z: A7&A6&A5&A4&A3&A2&A1&A0
Set if result is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
STA opr8a DIR B7 dd 3
Code, Cycles, and
STA opr16a EXT C7 hh ll 4
Access Details
STA oprx16,X IX2 D7 ee ff 4
STA oprx8,X IX1 E7 ff 3
STA ,X IX F7 2
STA oprx16,SP SP2 9ED7 ee ff 5
STA oprx8,SP SP1 9EE7 ff 4
Description Stores the contents of H in memory location M and then the contents of
X into the next memory location (M + $0001). The N condition code bit
is set if the most significant bit of H was set, the Z bit is set if the value of
H:X was $0000, and V is cleared. This allows conditional branching after
the store without having to do a separate test or compare.
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: R15
Set if MSB of result is 1; cleared otherwise
Z: R15&R14&R13&R12&R11&R10&R9&R8
&R7&R6&R5&R4&R3&R2&R1&R0
Set if the result is $0000; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
STHX opr DIR 35 dd 4
Code, Cycles, and
Access Details
When either the RESET pin or IRQ pin goes low, the oscillator is
enabled. A delay of 4095 processor clock cycles is imposed allowing the
oscillator to stabilize. The reset vector or interrupt request vector is
fetched and the associated service routine is executed.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — 0 — — —
Formulae
I: 0
Cleared
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
STOP INH 8E 1
Cycles, and
Access Detail
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: X7
Set if MSB of result is 1; cleared otherwise
Z: X7&X6&X5&X4&X3&X2&X1&X0
Set if X is $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
STX opr8a DIR BF dd 3
Code, Cycles, and
STX opr16a EXT CF hh ll 4
Access Details
STX oprx16,X IX2 DF ee ff 4
STX oprx8,X IX1 EF ff 3
STX ,X IX FF 2
STX oprx16,SP SP2 9EDF ee ff 5
STX oprx8,SP SP1 9EEF ff 4
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 — — ↕ ↕ ↕
Formulae
V: A7&M7&R7 | A7&M7&R7
Set if a two’s complement overflow resulted from the operation;
cleared otherwise. Literally read, an overflow condition occurs if
a positive number is subtracted from a negative number with a
positive result, or, if a negative number is subtracted from a
positive number with a negative result.
N: R7
Set if MSB of result is 1; cleared otherwise
Z: R7&R6&R5&R4&R3&R2&R1&R0
Set if result is $00; cleared otherwise
C: A7&M7 | M7&R7 | R7&A7
Set if the unsigned value of the contents of memory is larger than
the unsigned value of the accumulator; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
SUB #opr8i IMM A0 ii 2
Code, Cycles, and
SUB opr8a DIR B0 dd 3
Access Details
SUB opr16a EXT C0 hh ll 4
SUB oprx16,X IX2 D0 ee ff 4
SUB oprx8,X IX1 E0 ff 3
SUB X IX F0 2
SUB oprx16,SP SP2 9ED0 ee ff 5
SUB oprx8,SP SP1 9EE0 ff 4
Condition Codes
V H I N Z C
and Boolean
— 1 1 — 1 — — —
Formulae
I: 1
Set
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
SWI INH 83 9
Cycles, and
Access Detail
bit 7 6 5 4 3 2 1 bit 0
A
V 1 1 H I N Z C CCR
Carry/Borrow
Zero
Negative
I Interrupt
Mask
Half Carry
Overflow
(Two’s
Complement)
Description Transfers the contents of A to the condition code register (CCR). The
contents of A are unchanged. If this instruction causes the I bit to change
from 0 to 1, a one bus cycle delay is imposed before interrupts become
masked. This assures that the next instruction after a TAP instruction will
always be executed even if an interrupt became pending during the TAP
instruction.
Condition Codes
V H I N Z C
and Boolean
↕ 1 1 ↕ ↕ ↕ ↕ ↕
Formulae
Set or cleared according to the value that was in the accumulator.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TAP INH 84 2
Cycles, and
Access Detail
Description Loads X with the contents of the accumulator (A). The contents of A are
unchanged.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TAX INH 97 1
Cycles, and
Access Detail
bit 7 6 5 4 3 2 1 bit 0
A
V 1 1 H I N Z C CCR
Carry/Borrow
Zero
Negative
I Interrupt
Mask
Half Carry
Overflow
(Two’s
Complement)
Description Transfers the contents of the condition code register (CCR) into the
accumulator (A)
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TPA INH 85 1
Cycles, and
Access Detail
Condition Codes
V H I N Z C
and Boolean
0 1 1 — — ↕ ↕ —
Formulae
V: 0
Cleared
N: M7
Set if MSB of the tested value is 1; cleared otherwise
Z: M7&M6&M5&M4&M3&M2&M1&M0
Set if A, X, or M contains $00; cleared otherwise
Source Forms,
Addressing Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Modes, Machine
TST opr8a DIR 3D dd 3
Code, Cycles, and
TSTA INH (A) 4D 1
Access Details
TSTX INH (X) 5D 1
TST oprx8,X IX1 6D ff 3
TST ,X IX 7D 2
TST oprx8,SP SP1 9E6D ff 4
Description Loads index register (H:X) with 1 plus the contents of the stack pointer
(SP). The contents of SP remain unchanged. After a TSX instruction,
H:X points to the last value that was stored on the stack.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TSX INH 95 2
Cycles, and
Access Detail
Description Loads the accumulator (A) with the contents of X. The contents of X are
not altered.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TXA INH 9F 1
Cycles, and
Access Detail
Description Loads the stack pointer (SP) with the contents of the index register (H:X)
minus 1. The contents of H:X are not altered.
Source Form,
Addressing Mode, Source Address Machine Code HC08
Form Mode Opcode Operand(s) Cycles
Machine Code,
TXS INH 94 2
Cycles, and
Access Detail
When either the RESET or IRQ pin goes low or when any on-chip
system requests interrupt service, the processor clocks are enabled, and
the reset, IRQ, or other interrupt service request is processed.
Condition Codes
V H I N Z C
and Boolean
— 1 1 — 0 — — —
Formulae
I: 0
Cleared
Source Form,
Source Address Machine Code HC08
Addressing Mode, Form Mode Cycles
Opcode Operand(s)
Machine Code,
WAIT INH 8F 1
Cycles, and
Access Detail
6.1 Contents
6.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
6.2 Introduction
The M68HC08 Family instruction set is an extension of the M68HC05
Family instruction set. This section contains code examples for the
instructions unique to the M68HC08 Family.
**********************************
* DIVIDE: 8/8 divide
*
* SP ---> | |
* ---------------
* | A |
* ---------------
* | X | ^
* --------------- |
* | H | |
* --------------- |
* | PC (MS byte) | |
* --------------- |
* | PC (LS byte) | |
* --------------- |
* | Divisor |
* --------------- Decreasing
* | Dividend | Address
* ---------------
* | |
*
* Entry: Dividend and divisor on stack at
* SP,7 and SP,6 respectively
* Exit: 8-bit result placed on stack at SP,6
* A, H:X preserved
*
Label Operation Operand Comments
ORG $7000
TABLE FDB 512
* BGT:
* Read an 8-bit A/D register, sign it and test for valid range
*
* Entry: New reading in AD_RES
* Exit : Signed result in A. ERR_FLG set if out of range.
*
*
Label Operation Operand Comments
CLRX
CLRH
*
* NOTE: This sequence takes 2 cycles and uses 2 bytes
* LDHX #0 takes 3 cycles and uses 3 bytes.
*
BCD1 RMB 1
BCD2 RMB 1
*
LDA BCD1 ;Read first BCD byte
NSA ;Swap LS and MS nibbles
ADD BCD2 ;Add second BCD byte
*
TPA
*
* NOTE: Transfering the CCR to A does not modify the CCR.
*
TSTA
BMI V_SET
*
V_SET EQU *
*
Glossary
addressing mode — The way that the CPU obtains (addresses) the
information needed to complete an instruction. The M68HC08
CPU has 16 addressing modes.
binary — The binary number system using 2 as its base and using only
the digits 0 and 1. Binary is the numbering system used by
computers because any quantity can be represented by a series
of 1s and 0s. Electrically, these 1s and 0s are represented by
voltage levels of approximately VDD (input) and VSS (ground),
respectively.
control unit — One of two major units of the CPU. The control unit
contains logic functions that synchronize the machine and direct
various operations. The control unit decodes instructions and
generates the internal control signals that perform the requested
operations. The outputs of the control unit drive the execution
unit, which contains the arithmetic logic unit (ALU), CPU
registers, and bus interface.
CPU cycles — A CPU clock cycle is one period of the internal bus-rate
clock, normally derived by dividing a crystal oscillator source by
two or more so the high and low times are equal. The length of
time required to execute an instruction is measured in CPU clock
cycles.
CPU registers — Memory locations that are wired directly into the CPU
logic instead of being part of the addressable memory map. The
CPU always has direct access to the information in these
registers. The CPU registers in an M68HC08 are:
— A (8-bit accumulator)
— H:X (16-bit accumulator)
— SP (16-bit stack pointer)
— PC (16-bit program counter)
— CCR (condition code register containing the V, H, I, N, Z,
and C bits)
cycles — See “CPU cycles.”
execution unit (EU) — One of the two major units of the CPU
containing the arithmetic logic unit (ALU), CPU registers, and
bus interface. The outputs of the control unit drive the execution
unit.
H — Abbreviation for the upper byte of the 16-bit index register (H:X) in
the CPU08.
H:X — Abbreviation for the 16-bit index register in the CPU08. The
upper byte of H:X is called H. The lower byte is called X. In the
indexed addressing modes, the CPU uses the contents of H:X to
determine the effective address of the operand. H:X can also
serve as a temporary data storage location.
index register (H:X) — A 16-bit register in the CPU08. The upper byte
of H:X is called H. The lower byte is called X. In the indexed
addressing modes, the CPU uses the contents of H:X to
determine the effective address of the operand. H:X can also
serve as a temporary data storage location.
instruction. There are separate opcodes for 0-, 8-, and 16-bit
variations of indexed mode instructions, and so the CPU knows
how many additional memory locations to read after the opcode.
least significant bit (LSB) — The rightmost digit of a binary value; the
opposite of most significant bit (MSB).
LS — Least significant.
most significant bit (MSB) — The leftmost digit of a binary value; the
opposite of least significant bit (LSB).
pull — The act of reading a value from the stack. In the M68HC08, a
value is pulled by the following sequence of operations. First, the
stack pointer register is incremented so that it points to the last
value saved on the stack. Next, the value at the address
contained in the stack pointer register is read into the CPU.
push — The act of storing a value at the address contained in the stack
pointer register and then decrementing the stack pointer so that
it points to the next available stack location.
registers — Memory locations wired directly into the CPU logic instead
of being part of the addressable memory map. The CPU always
has direct access to the information in these registers. The CPU
registers in an M68HC08 are:
— A (8-bit accumulator)
— (H:X) (16-bit index register)
— SP (16-bit stack pointer)
— PC (16-bit program counter)
— CCR (condition code register containing the V, H, I, N, Z,
and C bits)
Memory locations that hold status and control information for
on-chip peripherals are called input/output (I/O) and control
registers.
call the subroutine. The CPU leaves the flow of the main
program to execute the instructions in the subroutine. When the
RTS instruction is executed, the CPU returns to the main
program where it left off.
X — Abbreviation for the lower byte of the index register (H:X) in the
CPU08.
Index
A
Accumulator (A). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Addressing modes
direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
indexed with post increment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
indexed, 16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
indexed, 8-bit offset with post increment . . . . . . . . . . . . . . . . . . . 78
indexed, no offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
memory to memory direct to direct. . . . . . . . . . . . . . . . . . . . . . . . 73
memory to memory direct to indexed with post increment. . . . . . 76
memory to memory immediate to direct. . . . . . . . . . . . . . . . . . . . 73
memory to memory indexed to direct with post increment. . . . . . 74
relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
stack pointer, 16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
stack pointer, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
C
Carry/borrow flag (C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Condition code register (CCR)
carry/borrow flag (C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
half-carry flag (H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
interrupt mask (I) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
negative flag (N). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
overflow flag (V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
zero flag (Z) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
CPU08
accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
condition code register (CCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
control unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
execution unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
index register (HX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
instruction execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33–35
internal timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
program counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
stack pointer (SP). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
D
Direct addressing mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
DMA (direct memory access module) . . . . . . . . . . . . . . . . . . . . . . . . 39
E
Extended addressing mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
H
HX (index register). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
I
Immediate addressing mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Index register (HX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Indexed with post increment addressing mode . . . . . . . . . . . . . . . . . 77
Indexed, 16-bit offset addressing mode . . . . . . . . . . . . . . . . . . . . . . 66
Indexed, 8-bit offset addressing mode . . . . . . . . . . . . . . . . . . . . . . . 65
Indexed, 8-bit offset with post increment addressing mode . . . . . . . 78
Indexed, no offset addressing mode . . . . . . . . . . . . . . . . . . . . . . . . . 65
Inherent addressing mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
L
Legal label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Literal expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
M
Memory to memory direct to direct addressing mode . . . . . . . . . . . . 73
Memory to memory direct to indexed
with post increment addressing mode . . . . . . . . . . . . . . . . . . . . . 76
Memory to memory immediate to direct addressing mode . . . . . . . . 73
Memory to memory indexed to direct with post increment
addressing mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Monitor mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
N
Negative flag (N) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Notation
Source forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
O
Opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Overflow flag (V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
P
Program counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
R
Register designators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Registers
accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
condition code (CCR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
index (HX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
program counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
stack pointer (SP). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Relative addressing mode
conditional branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Resets
arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
DMA (direct memory access module) . . . . . . . . . . . . . . . . . . . . . 39
exiting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
external . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
H register storage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
I bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
initial conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
internal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
local enable mask bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
masking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
monitor mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
resetting processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Resets (continued)
SIM (system integration module) . . . . . . . . . . . . . . . . . . . . . . 41, 48
sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
stacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
S
SIM (system integration module). . . . . . . . . . . . . . . . . . . . . . . . . 41, 48
Source form notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Stack pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Stack pointer, 16-bit offset addressing mode . . . . . . . . . . . . . . . . . . 68
Stack pointer, 8-bit offset addressing mode . . . . . . . . . . . . . . . . . . . 68
System integration module (SIM) . . . . . . . . . . . . . . . . . . . . . . . . 41, 48
T
Timing
control unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
internal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
interrupt processing flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
U
User mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
V
V (overflow flag). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Z
Zero flag (Z). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
JAPAN:
ASIA/PACIFIC:
Information in this document is provided solely to enable system and software
Motorola Semiconductors H.K. Ltd.;
Silicon Harbour Centre, 2 Dai King Street, implementers to use Motorola products. There are no express or implied copyright
Tai Po Industrial Estate, Tai Po, N.T., Hong Kong licenses granted hereunder to design or fabricate any integrated circuits or
852-26668334 integrated circuits based on the information in this document.
TECHNICAL INFORMATION CENTER: Motorola reserves the right to make changes without further notice to any products
herein. Motorola makes no warranty, representation or guarantee regarding the
1-800-521-6274
suitability of its products for any particular purpose, nor does Motorola assume any
HOME PAGE: liability arising out of the application or use of any product or circuit, and specifically
http://www.motorola.com/semiconductors disclaims any and all liability, including without limitation consequential or incidental
damages. “Typical” parameters which may be provided in Motorola data sheets
and/or specifications can and do vary in different applications and actual
performance may vary over time. All operating parameters, including “Typicals”
must be validated for each customer application by customer’s technical experts.
Motorola does not convey any license under its patent rights nor the rights of
others. Motorola products are not designed, intended, or authorized for use as
components in systems intended for surgical implant into the body, or other
applications intended to support or sustain life, or for any other application in which
the failure of the Motorola product could create a situation where personal injury or
death may occur. Should Buyer purchase or use Motorola products for any such
unintended or unauthorized application, Buyer shall indemnify and hold Motorola
and its officers, employees, subsidiaries, affiliates, and distributors harmless
against all claims, costs, damages, and expenses, and reasonable attorney fees
arising out of, directly or indirectly, any claim of personal injury or death associated
with such unintended or unauthorized use, even if such claim alleges that Motorola
was negligent regarding the design or manufacture of the part.
Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark
Office. digital dna is a trademark of Motorola, Inc. All other product or service
names are the property of their respective owners. Motorola, Inc. is an Equal
Opportunity/Affirmative Action Employer.
CPU08RM/AD