2 Architecture
2 Architecture
2 Architecture
Module 2
Architecture
68000 Architecture
Aims
To review the architecture of the 68000 microprocessor.
Describe and use the three simplest addressing modes of the 68000:
direct, absolute and immediate
Be able to access and understand the information presented in the
68000 Programmer’s Reference Manual
68000/ColdFire Background
Dual-In line Package (DIP), (DIL): Plastic leaded chip carrier (PLCC):
Package with a rectangular housing and Four-sided package. PLCC packages
two parallel rows of electrical connecting can be square or rectangular.
pins, usually protruding from the larger
sides of the package and bent downward.
Plastic
Chip case
Pins
End vie
w
68000/ColdFire Versions
68000 family has many versions.
680x0 means 68000, 68008, 68010, 68020, 68030, 68040 and 68060.
Newer versions are “upward compatible” with older versions.
The family is also affectionately called 68k or MC68k.
Most commonly found members are 68000, 68020, CPU32 and ColdFire.
The family includes 16-bit peripherals chips.
The 68000 can use 68000-type peripherals chips for higher performance or
older 6800-type peripherals for lower cost.
ColdFire is the current version
‘RISC’ified 68000 processor core.
Smaller, less power used than normal 68020.
A ColdFire chip is an embedded processor with integrated peripherals
You can find it in some HP laserjet printers
Today, the 68k family is made by Freescale Semiconductors.
Floating-Point
- - - - Off-chip Off-chip On-chip On-chip
Unit
Max Speed (MHz)
- - 20 - 33 50 40 75
Performance
- - 2 - 10 18 44 110
(MIPS)
* 68008 and 68010 are end-of-lifed (EOL) meaning no longer in production.
** Original 68000 has 16-bit bus. Current 68000 has selectable 8- or 16-bit bus.
68000 Hardware
Specifications
32-bit data and address
registers
16-bit data bus
24-bit address bus
14 addressing modes
Memory-mapped input-output
Program counter
56 instructions
5 main data types
7 interrupt levels
Clock speeds: 4 MHz to 12.5
MHz
Synchronous and
asynchronous data transfers
Data
D0-D7 8 32 bit Stores 8-/16-/32-bit data
registers
Stores 16-/32-bit pointers
Address (addresses of data)
A0-A6 7 32 bit
registers
Store a pointer to a
group of data known as
Stack the stack. Also known as
SP 2 32 bit A7. There’s two stack
pointer
pointers: USP and SSP.
Contains information on
the results of the last
instruction. Consists of
Status
SR 1 16 bit the system byte and the
Register
condition codes register
(CCR)
Control/Status Register
System Byte Status register stores an ”analysis” of the last operation involving the ALU
Only modifiable is supervisor mode
Register Register
Details in later modules
User Byte: CCR X
F
N L
For user-level programs Z A
Behavior depends on instruction
ALU V
G
C
S
Register
Bit Meaning
C Set if a carry or borrow is generated. Cleared
otherwise.
V Set if a signed overflow occurs. Cleared otherwise.
Z Set if the result is zero. Cleared otherwise.
N Set if the result is negative. Cleared otherwise.
Instruction Set
The complete list of instructions is known as the instruction set
Instructions are categorized according to basic operation
performed:
Data transfer
Arithmetic
Logic
Shifts & rotates
Bit manipulation
BCD
Program Control
System Control
Instruction Format
Generic instruction format
<label> opcode<.field> <operands> <;comments>
Instruction RTL
MOVE.W #100,D0 [D0] ← 100
MOVE.W $100,D0 [D0] ← [M(100)]
ADD.W D1,D0 [D0] ← [D0] + [D1]
MOVE.W D1,$100 [M(100)] ← D0
DATA DC.B 20 [DATA] ← 20
BRA LABEL [PC] ← label
Operands
Operands can be
Registers
Constants
Memory addresses
Operands specify addressing modes such as
Dn: data register direct MOVE.W D0, D1
An: address register indirect MOVE.W (A0),D1
#n: immediate MOVE.W #10,D1
N: absolute MOVE.W $1000,D1
Operands can be specified in several formats
Decimal: default
Hexadecimal: prefixed by $
Octal: prefixed by @
Binary: prefixed by %
ASCII: within single quotes ‘ABC’
Addressing Modes
Addressing mode : the mechanism used to compute the operand
address
68000 has sophisticated addressing modes
Simplifies assembler programming because it reduces the number steps
required to specify an address
68000 has 14 addressing modes but really falls into 6 major categories.
Register direct
We’ll cover the first
Immediate
three in this module.
Absolute The rest will be
Program counter relative covered later.
Register indirect
Inherent
Effective address : the actual address used by the instruction
Examples:
Data register D1 in the processor
Address $10000 in memory
A simple instruction
Format:
CLR.s <ea>
Example:
CLR.W D1 ;Clears lower word of D1
Before After
Effect:
D1 FE ED BE EF D1 FE ED 00 00
Format:
MOVE.s <ea>,<ea>
Example :
MOVE.W D0,D1 ;Copy lower word of D0 to D1
Effect:
Before After
D0 12 34 56 78 D0 12 34 56 78
berubah
D1 78 56 34 12 D1 78 56 56 78
Absolute Long:
1. Any address within the range $000000-
$FFFFFF may be used.
2. The full address is used. There is no sign
extension.
D3
Examples:
Machine instruction
Each instruction is at least 1 word, at most 5 words.
The first word is known as the operation word, which
determines:
Operation required
Data size: byte, word or longword
Length of the complete instruction
Where to find data (effective address)
The method of instruction encoding (how a instruction is
written in binary) is complex!
Summary
Register direct addressing is used for variables that can be held in
registers
Literal (immediate) addressing is used for constants that do not change
Direct (absolute) addressing is used for variables that reside in memory
The only difference between register direct addressing and direct
addressing is that the former uses registers to store operands and the
latter uses memory
For Further Info:
Motorola 68000 From Wikipedia, the free encyclopedia:
http://en.wikipedia.org/wiki/68000
CPU World - Motorola 68000 microprocessor family:
http://www.cpu-world.com/CPUs/68000
68000 Programmer’s Reference Manual
http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf
MOVE #5,D0 D0 =
MOVE #10,D0 D0 =
MOVE #-1,D0 D0 =
MOVE #$1234,D0 D0 =
MOVE #%1011,D0 D0 =
MOVE #@123,D0 D0 =
MOVE #’B’,D0 D0 =
MOVE.L #’HELP’,D0 D0 =
MOVE D1,D0 D0 =
MOVE D0,D1 D0 =
MOVE.B D1,D0 D0 =
MOVE.L D1,D0 D0 =
CLR.W D1 D0 =
CLR.B D0 D0 =
MOVE.B D1,D1 D0 =
MOVE.L D0,D1 D0 =
Opcodes
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0