Freescale Semiconductor M68HC08RG Reference Manual

M68hc08 series

Advertisement

Quick Links

Reference Guide
M68HC08RG/AD
Rev. 2, 3/2002
M68HC08
Family Reference Guide
Programming Model
Freescale Semiconductor, Inc.
1 5
H
1 5
1 5
TWO'S COMPLEMENT OVERFLOW
Figure 1. Programming Model
For More Information On This Product,
Go to: www.freescale.com
7
A
8
7
X
7
V
1
1
H
I
N
FLAG (V)
HALF-CARRY FLAG (H)
NEGATIVE FLAG (N)
INTERRUPT MASK (I)
0
ACCUMULATOR (A)
0
INDEX REGISTER (H:X)
0
STACK POINTER (SP)
0
PROGRAM COUNTER (PC)
0
CONDITION CODE
Z
C
REGISTER (CCR)
CARRY/BORROW FLAG (C)
ZERO FLAG (Z)
© Motorola, Inc., 2002

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the M68HC08RG and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Freescale Semiconductor M68HC08RG

  • Page 1 Freescale Semiconductor, Inc. Reference Guide M68HC08RG/AD Rev. 2, 3/2002 M68HC08 Family Reference Guide Programming Model ACCUMULATOR (A) INDEX REGISTER (H:X) STACK POINTER (SP) PROGRAM COUNTER (PC) CONDITION CODE REGISTER (CCR) CARRY/BORROW FLAG (C) TWO’S COMPLEMENT OVERFLOW FLAG (V) ZERO FLAG (Z)
  • Page 2 Freescale Semiconductor, Inc. M68HC08RG/AD Stacking UNSTACKING ORDER • • • CONDITION CODE REGISTER ACCUMULATOR INDEX REGISTER (LOW BYTE X) PROGRAM COUNTER HIGH PROGRAM COUNTER LOW • • • STACKING ORDER $00FF (DEFAULT ADDRESS ON RESET) 1. High byte (H) of index register is not stacked.
  • Page 3: Interrupt Vector Locations

    Freescale Semiconductor, Inc. M68HC08RG/AD Interrupt Vector Locations Table 1. M68HC08 Vectors Address Reset Priority FFFE Reset FFFC FFFA IREQ[0] FF02 IREQ[124] FF00 IREQ[125] Notation Used in Instruction Set Summary Table 2 for the instruction set summary. Operators = Contents of register or memory location shown inside parentheses ←...
  • Page 4 Freescale Semiconductor, Inc. M68HC08RG/AD Memory and Addressing = A memory location or absolute data, depending on addressing mode = A 16-bit value in two consecutive memory locations. The higher- M:M + $0001 order (most significant) eight bits are located at the address of M, and the lower-order (least significant) eight bits are located at the next higher sequential address.
  • Page 5 Freescale Semiconductor, Inc. M68HC08RG/AD Machine Coding Notation Low-order eight bits of a direct address $0000–$00FF (high byte assumed to be $00) Upper eight bits of 16-bit offset Lower eight bits of 16-bit offset or 8-bit offset One byte of immediate data...
  • Page 6 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 1 of 8) Effect Source on CCR Operation Description Form V H I N Z C ADC #opr8i ADC opr8a ADC opr16a hh ll ADC oprx16,X ee ff    A ←...
  • Page 7 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 2 of 8) Effect Source on CCR Operation Description Form V H I N Z C DIR (b0) DIR (b1) DIR (b2) DIR (b3) Mn ← 0 BCLR n,opr8a Clear Bit n in Memory –...
  • Page 8 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 3 of 8) Effect Source on CCR Operation Description Form V H I N Z C Branch if Interrupt Mask BMS rel Branch if (I) = 1 – – – – – – REL...
  • Page 9 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 4 of 8) Effect Source on CCR Operation Description Form V H I N Z C M ← $00 CLR opr8a A ← $00 CLRA X ← $00 CLRX H ← $00...
  • Page 10 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 5 of 8) Effect Source on CCR Operation Description Form V H I N Z C EOR #opr8i EOR opr8a EOR opr16a hh ll Exclusive OR EOR oprx16,X ee ff A ←...
  • Page 11 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 6 of 8) Effect Source on CCR Operation Description Form V H I N Z C LSR opr8a LSRA LSRX Logical Shift Right – – 0 LSR oprx8,X LSR ,X...
  • Page 12 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 7 of 8) Effect Source on CCR Operation Description Form V H I N Z C ROR opr8a RORA RORX Rotate Right through    – – ROR oprx8,X...
  • Page 13 Freescale Semiconductor, Inc. M68HC08RG/AD Table 2. Instruction Set Summary (Sheet 8 of 8) Effect Source on CCR Operation Description Form V H I N Z C SUB #opr8i SUB opr8a SUB opr16a hh ll SUB oprx16,X ee ff A ← (A) – (M)
  • Page 14: Addressing Modes

    Freescale Semiconductor, Inc. M68HC08RG/AD Addressing Modes Inherent (INH) The inherent addressing mode has no operand because the opcode contains all information necessary to carry out the instruction. Most inherent instructions are one byte long. Immediate (IMM) The operand in immediate mode instructions is contained in the byte(s) immediately following the opcode.
  • Page 15: Opcode Map

    Freescale Semiconductor, Inc. M68HC08RG/AD Relative (REL) Conditional branch instructions use the relative addressing mode. The EA of the operand depends on whether or not the branch is taken. If a branch is taken, the EA of the operand is formed by adding the signed byte following the opcode to the value of the PC, and the PC is loaded with the EA.
  • Page 16 Freescale Semiconductor, Inc. M68HC08RG/AD M68HC08 Family Reference Guide MOTOROLA For More Information On This Product, Go to: www.freescale.com...
  • Page 17 Freescale Semiconductor, Inc. M68HC08RG/AD Table 4. Hexadecimal to ASCII Conversion ASCII ASCII ASCII ASCII ‘ SP space grave “ quote & ‘ BEL beep apost. BS back HT tab linefeed , comma CR return dash period ESCAPE < > _ under...
  • Page 18: Hexadecimal To Decimal Conversion

    Freescale Semiconductor, Inc. M68HC08RG/AD Hexadecimal to Decimal Conversion To convert a hexadecimal number (up to four hexadecimal digits) to decimal, look up the decimal equivalent of each hexadecimal digit in Table 5. The decimal equivalent of the original hexadecimal number is the sum of the weights found in the table for all hexadecimal digits.
  • Page 19 Freescale Semiconductor, Inc. M68HC08RG/AD Decimal to Hexadecimal Conversion To convert a decimal number (up to 65,535 ) to hexadecimal, find the largest decimal number in Table 5 that is less than or equal to the number you are converting. The corresponding hexadecimal digit is the most significant hexadecimal digit of the result.
  • Page 20 Freescale Semiconductor, Inc. HOW TO REACH US: USA/EUROPE/LOCATIONS NOT LISTED: Motorola Literature Distribution; P.O. Box 5405, Denver, Colorado 80217 1-303-675-2140 or 1-800-441-2447 JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3-20-1, Minami-Azabu Minato-ku, Tokyo 106-8573 Japan 81-3-3440-3569 ASIA/PACIFIC: Information in this document is provided solely to enable system and software Motorola Semiconductors H.K.

This manual is also suitable for:

M68hc08ad

Table of Contents