MC68030 32-bit second-generation enhanced microprocessor. The manual consists of the
following sections and appendix. For detailed information on the MC68030 instruction set
refer to M68000PM/AD,
Section 1. Introduction
Section 2. Data Organization and Addressing Capabilities
Section 3. Instruction Set Summary
Section 4. Processing States
describes the capabilities, operation, and programming of the
M68000 Family Programmer's Reference Manual.
Section 5. Signal Description
Section 6. On-Chip Cache Memories
Section 7. Bus Operation
Section 8. Exception Processing
Section 9. Memory Management Unit
Section 10. Coprocessor Interface Description
Section 11. Instruction Execution Timing
Section 12. Applications Information
Section 13. Electrical Characteristics
Section 14. Ordering Information and Mechanical Data
Appendix A. M68000 Family Summary
Index
NOTE
In this manual, assertion and negation are used to specify forcing a signal to a particular state. In particular, assertion and assert refer to a signal that is active or true; negation and negate
indicate a signal that is inactive or false. These terms are used
independently of the voltage level (high or low) that they represent.
The audience of this manual includes systems designers, systems programmers, and
applications programmers. Systems designers need some knowledge of all sections, with
particular emphasis on Sections 1, 5, 6, 7, 13, 14, and Appendix A. Designers who
implement a coprocessor for their system also need a thorough knowledge of Section 10.
MOTOROLA
MC68030 USER’S MANUAL
xxiii
Systems programmers should become familiar with Sections 1, 2, 3, 4, 6, 8, 9, 11, and
Appendix A. Applications programmers can find most of the information they need in
Sections 1, 2, 3, 4, 9, 11, 12, and Appendix A.
From a different viewpoint, the audience for this book consists of users of other M68000
Family members and those who are not familiar with these microprocessors. Users of the
other family members can find references to similarities to and differences from the other
Motorola microprocessors throughout the manual. However, Section 1 and Appendix A
specifically identify the MC68030 within the rest of the family and contrast its differences.
6-8Single Entry Mode Operation — Misaligned Long Word and 8-Bit Port. . . 6-13
6-9Single Entry Mode Operation — Misaligned Long Word and 16-Bit Port. . 6-14
6-10Single Entry Mode Operation — Misaligned Long Word and 32-Bit
7-49Bus Error without DSACKx
7-50Late Bus Error with DSACKx
7-51Late Bus Error with STERM
7-52Long-Word Operand Request — Late BERR
7-53Long-Word Operand Request — BERR
The MC68030 is a second-generation full 32-bit enhanced microprocessor from Motorola.
The MC68030 is a member of the M68000 Family of devices that combines a central
processing unit (CPU) core, a data cache, an instruction cache, an enhanced bus controller,
and a memory management unit (MMU) in a single VLSI device. The processor is designed
to operate at clock speeds beyond 20 MHz. The MC68030 is implemented with 32-bit
registers and data paths, 32-bit addresses, a rich instruction set, and versatile addressing
modes.
The MC68030 is upward object code compatible with the earlier members of the M68000
Family and has the added features of an on-chip MMU, a data cache, and an improved bus
interface. It retains the flexible coprocessor interface pioneered in the MC68020 and
provides full IEEE floating-point support through this interface with the MC68881 or
MC68882 floating-point coprocessor. Also, the internal functional blocks of this
microprocessor are designed to operate in parallel, allowing instruction execution to be
overlapped. In addition to instruction execution, the internal caches, the on-chip MMU, and
the external bus controller all operate in parallel.
The MC68030 fully supports the nonmultiplexed bus structure of the MC68020, with 32 bits
of address and 32 bits of data. The MC68030 bus has an enhanced controller that supports
both asynchronous and synchronous bus cycles and burst data transfers. It also supports
the MC68020 dynamic bus sizing mechanism that automatically determines device port
sizes on a cycle-by-cycle basis as the processor transfers operands to or from external
devices.
A block diagram of the MC68030 is shown in Figure 1-1. The instructions and data required
by the processor are supplied from the internal caches whenever possible. The MMU
translates the logical address generated by the processor into a physical address utilizing
its address translation cache (ATC). The bus controller manages the transfer of data
between the CPU and memory or devices at the physical address.
MOTOROLA
MC68030 USER’S MANUAL
1-1
Introduction
BUS
DATA
DATA
PADS
INTERNAL
DATA
CACHE
HOLDING
REGISTER
B
STAGE
BUS
(CAHR)
CACHE
INSTRUCTION
SIZE
MULTIPLEXER
DATA
SECTION
DATA
MULTIPLEXER
MISALIGNMENT
CACHE
C
STAGE
INSTRUCTION PIPE
D
STAGE
STORE
CONTROL
CONTROL
MICROSEQUENCER AND
LOGIC
CONTROL
EXECUTION UNIT
BUS
ADDRESS
INSTRUCTION
SECTION
ADDRESS
SECTION
COUNTER
PROGRAM
ADDRESS
BUS
ADDRESS
UNIT
ACCESS
CONTROL
BUS
DATA
ADDRESS
BUFFER
PREFETCH PENDING
MICROBUS
BUS CONTROLLER
WRITE PENDING
CONTROLLER
BUFFER
SIGNALS
BUS CONTROL
1-2
PADS
ADDRESS
BUS
ADDRESS
Figure 1-1. Block Diagram
MC68030 USER’S MANUAL
MOTOROLA
1.1 FEATURES
The features of the MC68030 microprocessor are:
• Object Code Compatible with the MC68020 and Earlier M68000 Microprocessors
• Complete 32-Bit Nonmultiplexed Address and Data Buses
• 16 32-Bit General-Purpose Data and Address Registers
• Two 32-Bit Supervisor Stack Pointers and 10 Special-Purpose Control Registers
• 256-Byte Instruction Cache and 256-Byte Data Cache Can Be Accessed Simultaneously
• Paged MMU that Translates Addresses in Parallel with Instruction Execution and Internal Cache Accesses
• Two Transparent Segments Allow Untranslated Access to Physical Memory To Be D
fined for Systems That Transfer Large Blocks of Data between Predefined Physical Addresses — e.g., Graphics Applications
• Pipelined Architecture with Increased Parallelism Allows Accesses to Internal Caches
To Occur in Parallel with Bus Transfers and Instruction Execution To Be Overlapped
Introduction
• Enhanced Bus Controller Supports Asynchronous Bus Cycles (three clocks minimum),
Synchronous Bus Cycles (two clocks minimum), and Burst Data Transfers (one clock
minimum) all to the Physical Address Space
• Dynamic Bus Sizing Supports 8-, 16-, 32-Bit Memories and Peripherals
• Support for Coprocessors with the M68000 Coprocessor Interface — e.g., Full IEEE
Floating-Point Support Provided by the MC68881/MC68882 Floating-Point Coprocessors
• 4-Gbyte Logical and Physical Addressing Range
• Implemented in Motorola's HCMOS Technology That Allows CMOS and HMOS (HighDensity NMOS) Gates to be Combined for Maximum Speed, Low Power, and Optimum
Die Size
• Processor Speeds Beyond 20 MHz
Both improved performance and increased functionality result from the on-chip
implementation of the MMU and the data and instruction caches. The enhanced bus
controller and the internal parallelism also provide increased system performance. Finally,
the improved bus interface, the reduction in physical size, and the lower power consumption
combine to reduce system costs and satisfy cost/performance goals of the system designer.
MOTOROLA
MC68030 USER’S MANUAL
1-3
Introduction
1.2 MC68030 EXTENSIONS TO THE M68000 FAMILY
In addition to the on-chip instruction cache present in the MC68020, the MC68030 has an
internal data cache. Data that is accessed during read cycles may be stored in the on-chip
cache, where it is available for subsequent accesses. The data cache reduces the number
of external bus cycles when the data operand required by an instruction is already in the
data cache.
Performance is enhanced further because the on-chip caches can be internally accessed in
a single clock cycle. In addition, the bus controller provides a two-clock cycle synchronous
mode and burst mode accesses that can transfer data in as little as one clock per long word.
The MC68030 enhanced microprocessor contains an on-chip MMU that allows address
translation to operate in parallel with the CPU core, the internal caches, and the bus
controller.
Additional signals support emulation and system analysis. External debug equipment can
disable the on-chip caches and the MMU to freeze the MC68030 internal state during
breakpoint processing. In addition, the MC68030 indicates:
1. The start of a refill of the instruction pipe
2. Instruction boundaries
3. Pending trace or interrupt processing
4. Exception processing
5. Halt conditions
This status and control information allows external debugging equipment to trace the
MC68030 activity and interact nonintrusively with the MC68030 to effectively reduce system
debug effort.
1.3 PROGRAMMING MODEL
The programming model of the MC68030 consists of two groups of registers: the user model
and the supervisor model. This corresponds to the user and supervisor privilege levels. User
programs executing at the user privilege level use the registers of the user model. System
software executing at the supervisor level uses the control registers of the supervisor level
to perform supervisor functions.
1-4
MC68030 USER’S MANUAL
MOTOROLA
Introduction
Figure 1-2 shows the user programming model, consisting of 16 32-bit general-purpose registers and two control registers:
• General-Purpose 32-Bit Registers (D0–D7, A0–A7)
• 32-Bit Program Counter (PC)
• 8-Bit Condition Code Register (CCR)
The supervisor programming model consists of the registers available to the user plus 14
control registers:
• Two 32-Bit Supervisor Stack Pointers (ISP and MSP)
• 16-Bit Status Register (SR)
• 32-Bit Vector Base Register (VBR)
• 32-Bit Alternate Function Code Registers (SFC and DFC)
• 32-Bit Cache Control Register (CACR)
• 32-Bit Cache Address Register (CAAR)
• 64-Bit CPU Root Pointer (CRP)
• 64-Bit Supervisor Root Pointer (SRP)
• 32-Bit Translation Control Register (TC)
• 32-Bit Transparent Translation Registers (TT0 and TT1)
• 16-Bit MMU Status Register (MMUSR)
The user programming model remains unchanged from previous M68000 Family
microprocessors. The supervisor programming model supplements the user programming
model and is used exclusively by the MC68030 system programmers who utilize the
supervisor privilege level to implement sensitive operating system functions, I/O control, and
memory management subsystems. The supervisor programming model contains all the
controls to access and enable the special features of the MC68030. This segregation was
carefully planned so that all application software is written to run at the nonprivileged user
level and migrates to the MC68030 from any M68000 platform without modification. Since
system software is usually modified by system programmers when ported to a new design,
the control features are properly placed in the supervisor programming model. For example,
the transparent translation feature of the MC68030 is new to the family supervisor
programming model for the MC68030 and the two translation registers are new additions to
the family supervisor programming model for the MC68030. Only supervisor code uses this
feature, and user application programs remain unaffected.
MOTOROLA
MC68030 USER’S MANUAL
1-5
Introduction
Registers D0–D7 are used as data registers for bit and bit field (1 to 32 bits), byte (8 bit),
word (16 bit), long-word (32 bit), and quad-word (64 bit) operations. Registers A0–A6 and
the user, interrupt, and master stack pointers are address registers that may be used as
software stack pointers or base address registers. Register A7 (shown as A7' and A7'' in
Figure 1-3) is a register designation that applies to the user stack pointer in the user privilege
level and to either the interrupt or master stack pointer in the supervisor privilege level. In
the supervisor privilege level, the active stack pointer (interrupt or master) is called the
supervisor stack pointer (SSP). In addition, the address registers may be used for word and
long-word operations. All of the 16 general-purpose registers (D0–D7, A0–A7) may be used
as index registers.
3116 15
3116 150
31
31
16 15
15
87
7
0
D0
D1
D2
D3
D4
D5
D6
D7
A0
A1
A2
A3
A4
A5
A6
0
A7 (USP)
0
PC
0
CCR
DATA
REGISTERS
ADDRESS
REGISTERS
USER STACK
POINTER
PROGRAM
COUNTER
CONDITION
CODE
REGISTER
1-6
Figure 1-2. User Programming Model
MC68030 USER’S MANUAL
MOTOROLA
Introduction
The program counter (PC) contains the address of the next instruction to be executed by the
MC68030. During instruction execution and exception processing, the processor
automatically increments the contents of the PC or places a new value in the PC, as
appropriate.
31
31
31
31
31
31
31
31
16 15
16 15
15
15
0
0
870
(CCR)SR
0
0
0
0
0
0
0
A7' (ISP)
A7" (MSP)
VBR
SFC
DFC
CACR
CAAR
AC0
AC1
ACUSR
INTERRUPT
STACK POINTER
MASTER STACK
POINTER
STATUS REGISTER
VECTOR BASE
REGISTER
ALTERNATE FUNCTION
CODE REGISTERS
CACHE CONTROL
REGISTER
CACHE ADDRESS
REGISTER
ACCESS
CONTROL
REGISTER 0
ACCESS
CONTROL
REGISTER 1
ACU STATUS
REGISTER
Figure 1-3. Supervisor Programming Model Supplement
The status register, SR, (see Figure 1-4) stores the processor status. It contains the
condition codes that reflect the results of a previous operation and can be used for
conditional instruction execution in a program. The condition codes are extend (X), negative
(N), zero (Z), overflow (V), and carry (C). The user byte containing the condition codes is the
only portion of the status register information available in the user privilege level, and it is
referenced as the CCR in user programs. In the supervisor privilege level, software can
access the full status register, including the interrupt priority mask (three bits) as well as
additional control bits. These bits indicate whether the processor is in:
1. One of two trace modes (T1, T0)
2. Supervisor or user privilege level (S)
3. Master or interrupt mode (M)
The vector base register (VBR) contains the base address of the exception vector table in
memory. The displacement of an exception vector is added to the value in this register to
access the vector table.
MOTOROLA
MC68030 USER’S MANUAL
1-7
Introduction
Alternate function code registers, SFC and DFC, contain 3-bit function codes. Function
codes can be considered extensions of the 32-bit linear address that optionally provide as
many as eight 4-Gbyte address spaces. Function codes are automatically generated by the
processor to select address spaces for data and program at the user and supervisor
privilege levels and a CPU address space for processor functions (e.g., coprocessor
communications). Registers SFC and DFC are used by certain instructions to explicitly
specify the function codes for operations.
USER BYTE
(CONDITION CODE REGISTER)
CARRY
OVERFLOW
ZERO
NEGATIVE
EXTEND
1514131211109875643210
T1T0SM0I2I1I0XNZVC000
TRACE
ENABLE
SUPERVISOR/USER
STATE
MASTER/INTERRUPT
STATE
SYSTEM BYTE
INTERRUPT
PRIORITY MASK
Figure 1-4. Status Register
The cache control register (CACR) controls the on-chip instruction and data caches of the
MC68030. The cache address register (CAAR) stores an address for cache control
functions.
The CPU root pointer (CRP) contains a pointer to the root of the translation tree for the
currently executing task of the MC68030. This tree contains the mapping information for the
task's address space. When the MC68030 is configured to provide a separate address
space for supervisor routines, the supervisor root pointer (SRP) contains a pointer to the root
of the translation tree describing the supervisor's address space.
The translation control register (TC) consists of several fields that control address
translation. These fields enable and disable address translation, enable and disable the use
of SRP for the supervisor address space, and select or ignore the function codes in
translating addresses. Other fields define the size of memory pages, the number of address
bits used in translation, and the translation table structure.
The transparent translation registers, TT0 and TT1, can each specify separate blocks of
memory as directly accessible without address translation. Logical addresses in these areas
become the physical addresses for memory access. Function codes and the eight most
significant bits of the address can be used to define the area of memory and type of access;
either read, write, or both types of memory access can be directly mapped. The transparent
translation feature allows rapid movement of large blocks of data in memory or I/O space
without disturbing the context of the on-chip address translation cache or incurring delays
associated with translation table lookups. This feature is useful to graphics, controller, and
real-time applications.
1-8
MC68030 USER’S MANUAL
MOTOROLA
Introduction
The MMU status register (MMUSR) contains memory management status information
resulting from a search of the address translation cache or the translation tree for a particular
logical address.
1.4 DATA TYPES AND ADDRESSING MODES
Seven basic data types are supported:
1. Bits
2. Bit Fields (Fields of consecutive bits, 1–32 bits long)
In addition, the instruction set supports operations on other data types such as memory
addresses. The coprocessor mechanism allows direct support of floating-point operations
with the MC68881 and MC68882 floating-point coprocessors as well as specialized userdefined data types and functions.
The 18 addressing modes, shown in Table 1-1, include nine basic types:
1. Register Direct
2. Register Indirect
3. Register Indirect with Index
4. Memory Indirect
5. Program Counter Indirect with Displacement
6. Program Counter Indirect with Index
7. Program Counter Memory Indirect
8. Absolute
9. Immediate
The register indirect addressing modes can also postincrement, predecrement, offset, and
index addresses. The program counter relative mode also has index and offset capabilities.
As in the MC68020, both modes are extended to provide indirect reference through memory.
In addition to these addressing modes, many instructions implicitly specify the use of the
condition code register, stack pointer, and/or program counter.
1.5 INSTRUCTION SET OVERVIEW
The instructions in the MC68030 instruction set are listed in Table 1-2. The instruction set
has been tailored to support structured high-level languages and sophisticated operating
systems. Many instructions operate on bytes, words, or long words, and most instructions
can use any of the 18 addressing modes.
MOTOROLA
MC68030 USER’S MANUAL
1-9
Introduction
Table 1-1. Addressing Modes
Addressing ModesSyntax
Register Direct
Data Register Direct
Address Register Direct
Register Indirect
Address Register Indirect
Address Register Indirect with Postincrement
Address Register Indirect with Predecrement
Address Register Indirect with Displacement
Register Indirect with Index
Address Register Indirect with Index (8-BitDisplacement)
Address Register Indirect with Index (Base Displacement)
Memory Indirect
Memory Indirect Postindexed
Memory Indirect Preindexed
Program Counter Indirect with Displacement
Program Cou nter Indirect with IndexPC Indirect with Index (8-Bit
Displacement)
PC Indirect with Index (Base Displacement)
Program Counter Memory Indirect
PC Memory Indirect Postindexed
PC Memory Indirect Preindexed
Absolute
Absolute Short
Absolute Long
Immediate#(data)
Dn
An
(An)
(An)
–(An)
(d
,An)
16
(d
,An,Xn)
8
(bd,An,Xn)
([bd,An],Xn,od)
([bd,An,Xn],od)
(d
,PC)
16
(d
,PC,Xn)
8
(bd,PC,Xn)
([bd,PC],Xn,od)
([bd,PC,Xn],od)
(xxx).W
(xxx).L
NOTES:
Dn= Data Register, D0–D7
An= Address Register, A0–A7
d
8,
16= A twos-complement or sign-extended displacement; added as part of the effective address
calculation; size is 8 (d
) or 16 (d
8
) bits; when omitted, assemblers use a value of zero.
16
Xn= Address or data register used as an index register; form is Xn.SIZE*SCALE, where SIZE is .W
or .L indicates index register size) and SCALE is 1, 2, 4, or 8 (index register is multiplied by
SCALE); use of SIZE and/or SCALE is optional.
bd= A twos-complement base displacement;when present, size can be 16 or 32 bits.
od= Outer displacement, added as part of effective address calculation after any memory
indirection; use is optional with asize of 16 or 32 bits.
PC= Program Counter
(data)= Immediate value of 8, 16, or 32 bits
( )= Effective Address
[ ]= Use as indirect access to long-word address.
1-10
MC68030 USER’S MANUAL
MOTOROLA
Introduction
1.6 VIRTUAL MEMORY AND VIRTUAL MACHINE CONCEPTS
The full addressing range of the MC68030 is 4 Gbytes (4,294,967,296 bytes) in each of eight
address spaces. Even though most systems implement a smaller physical memory, the
system can be made to appear to have a full 4 Gbytes of memory available to each user
program by using virtual memory techniques.
In a virtual memory system, a user program can be written as if it has a large amount of
memory available, when the physical memory actually present is much smaller. Similarly, a
system can be designed to allow user programs to access devices that are not physically
present in the system, such as tape drives, disk drives, printers, terminals, and so forth. With
proper software emulation, a physical system can appear to be any other M68000 computer
system to a user program, and the program can be given full access to all of the resources
of that emulated system. Such an emulated system is called a virtual machine.
1.6.1 Virtual Memory
A system that supports virtual memory has a limited amount of high-speed physical memory
that can be accessed directly by the processor and maintains an image of a much larger
virtual memory on a secondary storage device such as a large-capacity disk drive. When
the processor attempts to access a location in the virtual memory map that is not resident in
physical memory, a page fault occurs. The access to that location is temporarily suspended
while the necessary data is fetched from secondary storage and placed in physical memory.
The suspended access is then either restarted or continued.
The MC68030 uses instruction continuation to support virtual memory. When a bus cycle is
terminated with a bus error, the microprocessor suspends the current instruction and
executes the virtual memory bus error handler. When the bus error handler has completed
execution, it returns control to the program that was executing when the error was detected,
reruns the faulted bus cycle (when required), and continues the suspended instruction.
MOTOROLA
MC68030 USER’S MANUAL
1-11
Introduction
Table 1-2. Instruction Set
MnemonicDescriptionMnemonicDescription
ABCDAdd Decimal with ExtendMOVE USPMove User Stack Pointer
ADDAddMOVECMove Control Register
ADDAAdd AddressMOVEMMove Multiple Registers
ADDIAdd ImmediateMOVEPMove Periphral
ADDQAdd QuickMOVEQMove Quick
ADDXAdd with ExtendMOVESMove Alternate Address Space
ANDLogical ANDMULSSigned Multiply
ANDILogical AND ImmediateMULUUnsigned Multiply
ASL, ASRArithmatic Shift Left and RightNBCDNegate Decimal with Extend
BccBranch ConditionallyNEGNegate
BCHGTest Bit and ChangeNEGXNegate with Extend
BCLRTest Bit and ClearNOPNo Operation
BFCHGTest Bit Feild and ChangeNOTLogical Compliment
BFCLRTest Bit Feild and ClearORLogical Inclusive OR
BFEXTSSigned Bit Feild ExtractORILogical Inclusive OR Immediate
BFEXTUUnsigned Bit Feild ExtractORI CCRLogical Inclusive OR Immediate to
BFFOBit Feild Find First OneCondition Codes
BFINSBit Feild InsertORI SRLogical Inclusive OR Immediate to
BFSETTest Bit Feild and SetStatus Register
BFTSTTest Bit Feild PACKPack BCD
BKPTBreakpoint PEAPush Effective Address
BRABranchPFLUSHFlush Entry(ies) in the ATC
BSETTest Bit and SetPFLUSHAFlush All Entries in the ATC
BSRBranch to SubroutinePLOADR,Load Entry into the ATC
BTSTTest BitPLOADW
CASCompare and Swap OperandsPMOVEMove to-from MMU Registers
CAS 2Compare and Swap Dual OperandsPMOVEFDMove to-from MMU Registers with
CHKCheck Register Against BoundFlush Disable
CHK2Check Register Against Upper andPTESTRTest a Logical Address
Lower BoundsPTESTW
CLRClearRESETReset External Devices
CMPCompareROL, RORRotate Left and Right
CMPACompare Address ROXL, ROXR Rotate With Extend Left and Right
CMPICompare ImmediateRTDReturn and Deallocate
CMPMCompare Memory to MemoryRTEReturn from Exception
CMP2Compare Registre Against Upper andRTRReturn and Restore Codes
Lower BoundsRTSReturn from Subroutine
DBccTest Condition, Decrement and BranchSBCDSubtract Decimal With Extend
DIVS, DIVSLSigned DivideSccSet Conditionally
DIVU, DIVULUnsigned DivideSTOPStop
EORLogical Exclusive ORSUBSubtract
EORILogical Exclusive OR ImmediateSUBASubtract Immediate
EXGExchange RegistersSUBISubtract Quick
EXT, EXTBSign ExtendSUBQSubtract with Extend
ILLEGALTake Illegal Instruction TrapSUBXSwap Register Words
JMPJumpSWAPTest Operand and Set
JSRJump to SubroutineTASTrap
LEALoad Effective AddressTRAPTrap Conditionally
LINKLink and AllocateTRAPccTrap on Overflow
LSL, LSRLogical Shift Left and RightTRAPVTest on Overflow
MOVEMoveTSTTest Operand
MOVEAMove Address
MOVE CCRMove Condition Code Register
MOVE SRMove Status Register
UNLK
UNPK
Unlink
Unpack BCD
1-12
MC68030 USER’S MANUAL
MOTOROLA
Introduction
MnemonicDescriptionMnemonicDescription
cpBcc
cpDBcc
cpGEN
Branch Conditionally
Test Coprocessor Condition,
Decrement and Branch
Coprocessor General Instruction
cpRESTORE
cpSAVE
cpScc
cpTRAPcc
Restore Internal State of Coprocessor
Save Internal State of Coprocessor
Set Conditionally
Trap Conditionally
1.6.2 Virtual Machine
A typical use for a virtual machine system is the development of software, such as an
operating system, for a new machine also under development and not yet available for
programming use. In a virtual machine system, a governing operating system emulates the
hardware of the new machine and allows the new software to be executed and debugged
as though it were running on the new hardware. Since the new software is controlled by the
governing operating system, it is executed at a lower privilege level than the governing
operating system. Thus, any attempts by the new software to use virtual resources that are
not physically present (and should be emulated) are trapped to the governing operating
system and performed by its software.
In the MC68030 implementation of a virtual machine, the virtual application runs at the user
privilege level. The governing operating system executes at the supervisor privilege level
and any attempt by the new operating system to access supervisor resources or execute
privileged instructions causes a trap to the governing operating system.
Instruction continuation is used to support virtual I/O devices in memory-mapped input/
output systems. Control and data registers for the virtual device are simulated in the memory
map. An access to a virtual register causes a fault and the function of the register is
emulated by software.
MOTOROLA
MC68030 USER’S MANUAL
1-13
Introduction
1.7 THE MEMORY MANAGEMENT UNIT
The MMU supports virtual memory systems by translating logical addresses to physical addresses using translation tables stored in memory. The MMU stores address mappings in
an address translation cache (ATC) that contains the most recently used translations. When
the ATC contains the address for a bus cycle requested by the CPU, a translation table
search is not performed. Features of the MMU include:
• Multiple Level Translation Tables with Short- and Long-Format Descriptors for Efficient
Table Space Usage
• Table Searches Automatically Performed in Microcode
• 22-Entry Fully Associative ATC
• Address Translations and Internal Instruction and Data Cache Accesses Performed in
Parallel
• Eight Page Sizes Available Ranging from 256 to 32K Bytes
• Two Optional Transparent Blocks
• User and Supervisor Root Pointer Registers
• Write Protection and Supervisor Protection Attributes
• Translations Enabled/Disabled by Software
• Translations Can Be Disabled with External MMUDIS
Signal
• Used and Modified Bits Automatically Maintained in Tables and ATC
• Cache Inhibit Output (CIOUT
) Signal Can Be Asserted on a Page-by-Page Basis
• 32-Bit Internal Logical Address with Capability To Ignore as many as 15 Upper Address
Bits
• 3-Bit Function Code Supports Separate Address Spaces
• 32-Bit Physical Address
The memory management function performed by the MMU is called demand paged memory
management. Since a task specifies the areas of memory it requires as it executes, memory
allocation is supported on a demand basis. If a requested access to memory is not currently
mapped by the system, then the access causes a demand for the operating system to load
or allocate the required memory image. The technique used by the MC68030 is paged
memory management because physical memory is managed in blocks of a specified
number of bytes, called page frames. The logical address space is divided into fixed-size
pages that contain the same number of bytes as the page frames. Memory management
assigns a physical base address to a logical page. The system software then transfers data
between secondary storage and memory one or more pages at a time.
1-14
MC68030 USER’S MANUAL
MOTOROLA
Introduction
1.8 PIPELINED ARCHITECTURE
The MC68030 uses a three-stage pipelined internal architecture to provide for optimum
instruction throughput. The pipeline allows as many as three words of a single instruction or
three consecutive instructions to be decoded concurrently.
1.9 THE CACHE MEMORIES
Due to locality of reference, instructions and data that are used in a program have a high
probability of being reused within a short time. Additionally, instructions and data operands
that reside in proximity to the instructions and data currently in use also have a high
probability of being utilized within a short period. To exploit these locality characteristics, the
MC68030 contains two on-chip logical caches, a data cache, and an instruction cache.
Each of the caches stores 256 bytes of information, organized as 16 entries, each containing
a block of four long words (16 bytes). The processor fills the cache entries either one long
word at a time or, during burst mode accesses, four long words consecutively. The burst
mode of operation not only fills the cache efficiently but also captures adjacent instruction or
data items that are likely to be required in the near future due to locality characteristics of
the executing task.
The caches improve the overall performance of the system by reducing the number of bus
cycles required by the processor to fetch information from memory and by increasing the
bus bandwidth available for other bus masters in the system. Addition of the data cache in
the MC68030 extends the benefits of cache techniques to all memory accesses. During a
write cycle, the data cache circuitry writes data to a cached data item as well as to the item
in memory, maintaining consistency between data in the cache and that in memory.
However, writing data that is not in the cache may or may not cause the data item to be
stored in the cache, depending on the write allocation policy selected in the cache control
register (CACR).
MOTOROLA
MC68030 USER’S MANUAL
1-15
SECTION 2
DATA ORGANIZATION AND ADDRESSING
CAPABILITIES
Most external references to memory by a microprocessor are either program references or
data references; they either access instruction words or operands (data items) for an
instruction. Program references are references to the program space, the section of memory
that contains the program instructions and any immediate data operands that reside in the
instruction stream. Refer to M68000PM/AD,
descriptions of the instructions in the program space. Data references refer to the data
space, the section of memory that contains the program data. Data items in the instruction
stream can be accessed with the program counter relative addressing modes, and these
accesses are classified as program references. A third type of external reference used for
coprocessor communications, interrupt acknowledge cycles, and breakpoint acknowledge
cycles is classified as a CPU space reference. The MC68030 automatically sets the function
codes to access the program space, the data space, or the CPU space for special functions
as required. The function codes can be used by the memory management unit to organize
separate program (read only) and data (read-write) memory areas.
M68000 Programmer's Reference Manual
, for
This section describes the data organization and addressing capabilities of the MC68030. It
lists the types of operands used by instructions and describes the registers and their use as
operands. Next, the section describes the organization of data in memory and the
addressing modes available to access data in memory. Last, the section describes the
system stack and user program stacks and queues.
2.1 INSTRUCTION OPERANDS
The MC68030 supports a general-purpose set of operands to serve the requirements of a
large range of applications. Operands of MC68030 instructions may reside in registers, in
memory, or within the instructions themselves. An instruction operand might also reside in
a coprocessor. An operand may be a single bit, a bit field of from 1 to 32 bits in length, a byte
(8 bits), a word (16 bits), a long word (32 bits), or a quad word (64 bits). The operand size
for each instruction is either explicitly encoded in the instruction or implicitly defined by the
instruction operation. Coprocessors are designed to support special computation models
that require very specific but widely varying data operand types and sizes. Hence,
coprocessor instructions can specify operands of any size.
MOTOROLA
MC68030 USER’S MANUAL
2-1
Data Organization and Addressing Capabilities
2.2 ORGANIZATION OF DATA IN REGISTERS
The eight data registers can store data operands of 1, 8, 16, 32, and 64 bits, addresses of
16 or 32 bits, or bit fields of 1 to 32 bits. The seven address registers and the three stack
pointers are used for address operands of 16 or 32 bits. The control registers (SR, VBR,
SFC, DFC, CACR, CAAR, CRP, SRP, TC, TT0, TT1, and MMUSR) vary in size according
to function. Coprocessors may define unique operand sizes and support them with on-chip
registers accordingly.
2.2.1 Data Registers
Each data register is 32 bits wide. Byte operands occupy the low-order 8 bits, word
operands the low-order 16 bits, and long-word operands the entire 32 bits. When a data
register is used as either a source or destination operand, only the appropriate low-order
byte or word (in byte or word operations, respectively) is used or changed; the remaining
high-order portion is neither used nor changed. The least significant bit of a long-word
integer is addressed as bit zero, and the most significant bit is addressed as bit 31. For bit
fields, the most significant bit is addressed as bit zero, and the least significant bit is
addressed as the width of the field minus one. If the width of the field plus the offset is greater
than 32, the bit field wraps around within the register. The following illustration shows the
organization of various types of data in the data registers.
Quad-word data consists of two long words; for example, the product of 32-bit multiply or
the quotient of 32-bit divide operations (signed and unsigned). Quad words may be
organized in any two data registers without restrictions on order or pairing. There are no
explicit instructions for the managment of this data type, although the MOVEM instruction
can be used to move a quad word into or out of the registers.
Binary-coded decimal (BCD) data represents decimal numbers in binary form. Although
many BCD codes have been devised, the BCD instructions of the M68000 Family support
formats which the four least significant bits consist of a binary number having the numeric
value of the corresponding decimal number. Two BCD formats are used. In the unpacked
BCD format, a byte contains one digit; the four least significant bits contain the binary value
and the four most significant bits are undefined. Each byte of the packed BCD format
contains two digits; the least significant four bits contain the least significant digit.
Note: If width + offset < 32, bit filed wraps around within the register.
Unpacked BCD (a = MSB)
31876543210
xxxxabcd
Packed BCD (a = MSB First Digit, e = MSB Second Digit)
31876543210
abcdefgh
MOTOROLA
Data Organization in Data Registers
MC68030 USER’S MANUAL
2-3
Data Organization and Addressing Capabilities
2.2.2 Address Registers
Each address register and stack pointer is 32 bits wide and holds a 32-bit address. Address
registers cannot be used for byte-sized operands. Therefore, when an address register is
used as a source operand, either the low-order word or the entire long-word operand is
used, depending upon the operation size. When an address register is used as the
destination operand, the entire register is affected, regardless of the operation size. If the
source operand is a word size, it is first sign-extended to 32 bits and then used in the
operation to an address register destination. Address registers are used primarily for
addresses and to support address computation. The instruction set includes instructions
that add to, subtract from, compare, and move the contents of address registers. The
following example shows the organization of addresses in address registers.
3116 150
Sign-Extended16-Bit Address Operand
310
Full 32-Bit Address Operand
Address Organization in Address Registers
2.2.3 Control Registers
The control registers described in this section contain control information for supervisor
functions and vary in size. With the exception of the user portion of the status register (CCR),
they are accessed only by instructions at the supervisor privilege level.
The status register (SR), shown in Figure 1–4, is 16 bits wide. Only 12 bits of the status
register are defined; all undefined values are reserved by Motorola for future definition. The
undefined bits are read as zeros and should be written as zeros for future compatibility. The
lower byte of the status register is the CCR. Operations to the CCR can be performed at the
supervisor or user privilege level. All operations to the status register and CCR are wordsized operations, but for all CCR operations, the upper byte is read as all zeros and is
ignored when written, regardless of privilege level.
2-4
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
The supervisor programming model (see Figure 1–3) shows the control registers. The cache
control register (CACR) provides control and status information for the on-chip instruction
and data caches. The cache address register (CAAR) contains the address for cache control
functions. The vector base register (VBR) provides the base address of the exception vector
table. All operations involving the CACR, CAAR, and VBR are long-word operations,
whether these registers are used as the source or the destination operand.
The alternate function code registers (SFC and DFC)
are 32-bit registers with only bits 2:0 implemented that contain the address space values
(FC0-FC2) for the read or write operands of MOVES, PLOAD, PFLUSH, and PTEST
instructions. The MOVEC instruction is used to transfer values to and from the alternate
function code registers. These are long-word transfers; the upper 29 bits are read as zeros
and are ignored when written.
The remaining control registers in the supervisor programming model are used by the
memory management unit (MMU). The CPU root pointer (CRP) and supervisor root pointer
(SRP) contain pointers to the user and supervisor address translation trees. Transfers of
data to and from these 64-bit registers are quad-word transfers. The translation control
register (TC) contains control information for the MMU. The MC68030 always uses longword transfers to access this 32-bit register. The transparent translation registers (TT0 and
TT1) also contain 32 bits each; they identify memory areas for direct addressing without
address translation. Data transfers to and from these registers are long-word transfers. The
MMU status register (MMUSR) stores the status of the MMU after execution of a PTEST
instruction. It is a 16-bit register, and transfers to and from the MMUSR are word transfers.
Refer to Section 9 Memory Management Unit for more detail.
2.3 ORGANIZATION OF DATA IN MEMORY
Memory is organized on a byte-addressable basis where lower addresses correspond to
higher order bytes. The address, N, of a long-word data item corresponds to the address of
the most significant byte of the highest order word. The lower order word is located at
address N + 2, leaving the least significant byte at address N + 3 (refer to Figure 2–1). Notice
that the MC68030 does not require data to be aligned on word boundaries (refer to Figure
2–2), but the most efficient data transfers occur when data is aligned on the same byte
boundary as its operand size. However, instruction words must be aligned on word
boundaries.
MOTOROLA
MC68030 USER’S MANUAL
2-5
Data Organization and Addressing Capabilities
The data types supported in memory by the MC68030 are bit and bit field data; integer data
of 8, 16, or 32 bits; 32-bit addresses; and BCD data (packed and unpacked). These data
types are organized in memory as shown in Figure 2–2. Note that all of these data types can
be accessed at any byte address.
Coprocessors can implement any data types and lengths up to 255 bytes. For example, the
MC68881/MC68882 floating-point coprocessors support memory accesses for quad-wordsized items (double-precision floating-point values).
Figure 2A bit operand is specified by a base address that selects one byte in memory (the
base byte) and a bit number that selects the one bit in this byte. The most significant bit of
the byte is bit 7.
31231570
LONG WORD $00000000
WORD $00000000
BYTE $00000000
WORD $00000004
BYTE $00000004
WORD $FFFFFFFC
BYTE $FFFFFFFC
WORD $00000002
BYTE $00000001BYTE $00000002BYTE $00000003
LONG WORD $00000004
WORD $00000006
BYTE $00000005BYTE $00000006BYTE $00000007
LONG WORD $FFFFFFFC
WORD $FFFFFFFE
BYTE $FFFFFFFDBYTE $FFFFFFFEBYTE $FFFFFFFF
Figure 2-1. Memory Operand Address
2-6
MC68030 USER’S MANUAL
MOTOROLA
BYTE n - 1
Data Organization and Addressing Capabilities
BIT DATA
07707070
BYTE n - 1BYTE n + 1
BASE ADDRESSBIT NUMBER
BYTE n - 1
OFFSET
BYTE n - 1BYTE n + 2
0
77
7 6 5 4 3 2 1 0BYTE n + 2
BIT FIELD DATABASE BIT
07707070
BYTE n0 1 2 3 ...........w - 1
WIDTHOFFSET
...3-2-1 0 1 2...
BASE ADDRESS
07707070
ADDRESS
WORD INTEGER DATA
0
0707070
7
WORD INTEGERBYTE n + 2BYTE n + 3
BYTE INTEGER DATA
BYTE n + 1MSB BYTE n LSB
0
77
BYTE n - 1
ADDRESS
ADDRESS
0
77
BYTE n - 1
XX = USER DEFINED VALUE
ADDRESS
0
7
70
70
LONG-WORD INTEGERBYTE n + 4
QUAD-WORD DATA
BYTE n - 1BYTE n + 2BYTE n + 1MSDLSD
BYTE n - 1BYTE n + 2
70
QUAD WORD
PACKED BINARY-CODED DATA
07707070
ADDRESS
07707070
ADDRESS
43
UNPACKED BINARY-CODED DATA
43
XXMSD
07070
07070
BYTE n + 8
43
XXLSD
MOTOROLA
Figure 2-2. Memory Data Organization
MC68030 USER’S MANUAL
2-7
Data Organization and Addressing Capabilities
A bit field operand is specified by:
1. A base address that selects one byte in memory,
2. A bit field offset that indicates the leftmost (base) bit of the bit field in relation to the
most significant bit of the base byte, and
3. A bit field width that determines how many bits to the right of the base bit are in the bit
field.
The most significant bit of the base byte is bit field offset 0, the least significant bit of the
base byte is bit field offset 7, and the least significant bit of the previous byte in memory is
bit offset –1. Bit field offsets may have values in the range of –2
31
to 2
31
–1, and bit field
widths may range between 1 and 32 bits.
2.4 ADDRESSING MODES
The addressing mode of an instruction can specify the value of an operand (with an
immediate operand), a register that contains the operand (with the register direct addressing
mode), or how the effective address of an operand in memory is derived. An assembler
syntax has been defined for each addressing mode.
Figure 2–3 shows the general format of the single effective address instruction operation
word. The effective address field specifies the addressing mode for an operand that can use
one of the numerous defined modes. The (eaL designation is composed of two 3-bit fields:
the mode field and the register field. The value in the mode field selects one or a set of
addressing modes. The register field specifies a register for the mode or a submode for
modes that do not use registers.
15
XXXXXXXXXX
1413121110987650
EFFECTIVE ADDRESS
MODEREGISTER
Figure 2-3. Single Effective Address
Many instructions imply the addressing mode for one of the operands. The formats of these
instructions include appropriate fields for operands that use only one addressing mode.
2-8
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
The effective address field may require additional information to fully specify the operand
address. This additional information, called the effective address extension, is contained in
an additional word or words and is considered part of the instruction. Refer to 2.5 Effective
Address Encoding Summary for a description of the extension word formats.
The notational conventions used in the addressing mode descriptions in this section are:
EA—Effective address
An—Address register n
Example: A3 is address register 3
Dn—Data register n
Example: D5 is data register 5
Xn.SIZE*SCALE—Denotes index register n (data or address), the index size
(W for word, L for long word), and a scale factor (1, 2, 4,
or 8 for no, word, long-word, or quad-word scaling, respectively).
PC—The program counter
d
n
—Displacement value, n bits wide
bd—Base displacement
od—Outer displacement
L—Long-word size
W—Word size
( )—Identify an indirect address in a register
[ ]—Identify an indirect address in memory
When the addressing mode uses a register, the register field of the operation word specifies
the register to be used. Other fields within the instruction specify whether the register
selected is an address or data register and how the register is to be used.
2.4.1 Data Register Direct Mode
In the data register direct mode, the operand is in the data register specified by the effective
address register field.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
DATA REGISTER:
NUMBER OF EXTENSION WORDS:
EA = Dn
Dn
000
n
Dn
0
310
OPERAND
OPERAND
MOTOROLA
MC68030 USER’S MANUAL
2-9
Data Organization and Addressing Capabilities
2.4.2 Address Register Direct Mode
In the address register direct mode, the operand is in the address register specified by the
effective address register field.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
ADDRESS REGISTER:
NUMBER OF EXTENSION WORDS:
EA = An
An
001
n
An
0
310
OPERAND
2.4.3 Address Register Indirect Mode
In the address register indirect mode, the operand is in memory, and the address of the
operand is in the address register specified by the register field.
2.4.4 Address Register Indirect with Postincrement Mode
In the address register indirect with postincrement mode, the operand is in memory, and the
address of the operand is in the address register specified by the register field. After the
operand address is used, it is incremented by one, two, or four depending on the size of the
operand: byte, word, or long word. Coprocessors may support incrementing for any size of
operand up to 255 bytes. If the address register is the stack pointer and the operand size is
byte, the address is incremented by two rather than one to keep the stack pointer aligned to
a word boundary.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
ADDRESS REGISTER:
OPERAND LENGTH ( 1, 2, OR 4):
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS:
EA = (An)
An = An + SIZE
(An) +
011
n
An
0
310
MEMORY ADDRESS
+
310
OPERAND
2-10
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
2.4.5 Address Register Indirect with Predecrement Mode
In the address register indirect with predecrement mode, the operand is in memory, and the
address of the operand is in the address register specified by the register field. Before the
operand address is used, it is decremented by one, two, or four depending on the operand
size: byte, word, or long word. Coprocessors may support decrementing for any operand
size up to 255 bytes. If the address register is the stack pointer and the operand size is byte,
the address is decremented by two rather than one to keep the stack pointer aligned to a
word boundary.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
ADDRESS REGISTER:
OPERAND LENGTH (1, 2, OR 4):
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS: 0
An = An – SIZE
EA = (An)
– (An)
100
n
An
310
MEMORY ADDRESS
310
OPERAND
MOTOROLA
MC68030 USER’S MANUAL
2-11
Data Organization and Addressing Capabilities
2.4.6 Address Register Indirect with Displacement Mode
In the address register indirect with displacement mode, the operand is in memory. The
address of the operand is the sum of the address in the address register plus the signextended 16-bit displacement integer in the extension word. Displacements are always signextended to 32 bits prior to being used in effective address calculations.
2.4.7 Address Register Indirect with Index (8-Bit Displacement) Mode
This addressing mode requires one extension word that contains the index register indicator
and an 8-bit displacement. The index register indicator includes size and scale information.
In this mode, the operand is in memory. The address of the operand is the sum of the
contents of the address register, the sign-extended displacement value in the low-order
eight bits of the extension word, and the sign-extended contents of the index register
(possibly scaled). The user must specify the displacement, the address register, and the
index register in this mode.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
ADDRESS REGISTER:
31
DISPLACEMENT:
31
310
INDEX REGISTER
SCALE:
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS:
EA = (An) + (XN) + d
(d ,An,Xn.SIZE*SCALE)
8
110
n
An
SIGN EXTENDED
SIGN-EXTENDED VALUE
7
SCALE VALUE
1
8
310
MEMORY ADDRESS
7
INTEGER
310
0
+
0
0
X
OPERAND
+
2-12
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
2.4.8 Address Register Indirect with Index (Base Displacement) Mode
This addressing mode requires an index register indicator and an optional 16- or 32-bit signextended base displacement. The index register indicator includes size and scaling
information. The operand is in memory. The address of the operand is the sum of the
contents of the address register, the scaled contents of the sign-extended index register,
and the base displacement.
In this mode, the address register, the index register, and the displacement are all optional.
If none is specified, the effective address is zero. This mode provides a data register indirect
address when no address register is specified and the index register is a data register (Dn).
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS: 1,2, OR 3
EA = (An) + (Xn) + bd
(bd,An,Xn.SIZE*SCALE)
110
n
An
SIGN-EXTENDED VALUE
SIGN-EXTENDED VALUE
7
310
MEMORY ADDRESS
+
0
SCALE VALUE
310
X
OPERAND
+
MOTOROLA
MC68030 USER’S MANUAL
2-13
Data Organization and Addressing Capabilities
2.4.9 Memory Indirect Postindexed Mode
In this mode, the operand and its address are in memory. The processor calculates an
intermediate indirect memory address using the base register (An) and base displacement
(bd). The processor accesses a long word at this address and adds the index operand
(Xn.SIZE*SCALE) and the outer displacement to yield the effective address. Both
displacements and the index register contents are sign-extended to 32 bits.
In the syntax for this mode, brackets enclose the values used to calculate the intermediate
memory address. All four user-specified values are optional. Both the base and outer
displacements may be null, word, or long word. When a displacement is omitted or an
element is suppressed, its value is taken as zero in the effective address calculation.
EA = (bd + An) + Xn.SIZE*SCALE + od
([bd,An],Xn.SIZE*SCALE,od)
110
An
SIGN-EXTENDED VALUE
310
MEMORY ADDRESS
+
310
INDEX REGISTER:
SCALE:
310
OUTER DISPLACEMENT:
EFFECTIVE ADDRESS:
NUMBER OF EXTENSION WORDS: 1,2, 3, 4, OR 5
SIGN-EXTENDED VALUE
7
SIGN-EXTENDED VALUE
310
INDIRECT MEMORY ADDRESS
X
POINTS TO
+
310
VALUE AT INDIRECT MEMORY ADDRESS
0
SCALE VALUE
+
310
OPERAND
2-14
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
2.4.10 Memory Indirect Preindexed Mode
In this mode, the operand and its address are in memory. The processor calculates an
intermediate indirect memory address using the base register (An), a base displacement
(bd), and the index operand (Xn.SIZE * SCALE). The processor accesses a long word at
this address and adds the outer displacement to yield the effective address. Both
displacements and the index register contents are sign-extended to 32 bits.
In the syntax for this mode, brackets enclose the values used to calculate the intermediate
memory address. All four user-specified values are optional. Both the base and outer
displacements may be null, word, or long word. When a displacement is omitted or an
element is suppressed, its value is taken as zero in the effective address calculation.
EA = (bd + An + Xn.SIZE*SCALE) + od
([bd,An,Xn.SIZE*SCALE],od)
110
An
SIGN-EXTENDED VALUE
310
MEMORY ADDRESS
+
310
SIGN-EXTENDED VALUE
7
INDEX REGISTER:
SCALE:
310
OUTER DISPLACEMENT:
EFFECTIVE ADDRESS:
NUMBER OF EXTENSION WORDS: 1,2, 3, 4, OR 5
SIGN-EXTENDED VALUE
0
SCALE VALUE
310
INDIRECT MEMORY ADDRESS
310
VALUE AT INDIRECT MEMORY ADDRESS
X
+
POINTS TO
+
310
OPERAND
MOTOROLA
MC68030 USER’S MANUAL
2-15
Data Organization and Addressing Capabilities
2.4.11 Program Counter Indirect with Displacement Mode
In this mode, the operand is in memory. The address of the operand is the sum of the
address in the PC and the sign-extended 16-bit displacement integer in the extension word.
The value in the PC is the address of the extension word. The reference is a program space
reference and is only allowed for reads (refer to 4.2 Address Space Types ).
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
PROGRAM COUNTER:
DISPLACEMENT: INTEGER
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS: 1
SIGN EXTENDED
EA = (PC) + d
d ,PC)
16
111
010
15
16
310
ADDRESS OF EXTENSION WORD
031
+
310
OPERAND
2.4.12 Program Counter Indirect with Index (8-Bit Displacement) Mode
This mode is similar to the address register indirect with index (8-bit displacement) mode
described in 2.4.7 Address Register Indirect with Index (8-Bit Displacement) Mode , but
the PC is used as the base register. The operand is in memory. The address of the operand
is the sum of the address in the PC, the sign-extended displacement integer in the lower
eight bits of the extension word, and the sized, scaled, and sign-extended index operand.
The value in the PC is the address of the extension word. This reference is a program space
reference and is only allowed for reads. The user must include the displacement, the PC,
and the index register when specifying this addressing mode.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
PROGRAM COUNTER:
310
DISPLACEMENT:
310
INDEX REGISTER
SCALE:
NUMBER OF EXTENSION WORDS:
EA = (PC) + (Xn) + d
(d , PC,Xn. SIZE*SCALE)
111
011
SIGN EXTENDED
SIGN-EXTENDED VALUE
8
8
310
ADDRESS OF EXTENSION WORD
7
INTEGER
70
SCALE VALUE
310
1
X
OPERANDMEMORY ADDRESS:
+
+
2-16
MC68030 USER’S MANUAL
MOTOROLA
Data Organization and Addressing Capabilities
2.4.13 Program Counter Indirect with Index (Base Displacement) Mode
This mode is similar to the address register indirect with index (base displacement) mode
described in 2.4.8 Address Register Indirect with Index (Base Displacement) Mode , but
the PC is used as the base register. It requires an index register indicator and an optional
16- or 32-bit sign-extended base displacement. The operand is in memory. The address of
the operand is the sum of the contents of the PC, the scaled contents of the sign-extended
index register, and the base displacement. The value of the PC is the address of the first
extension word. The reference is a program space reference and is only allowed for reads
(refer to 4.2 Address Space Types ).
In this mode, the PC, the index register, and the displacement are all optional. However, the
user must supply the assembler notation "ZPC'' (zero value is taken for the PC) to indicate
that the PC is not used. This allows the user to access the program space without using the
PC in calculating the effective address. The user can access the program space with a data
register indirect access by placing ZPC in the instruction and specifying a data register (Dn)
as the index register.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER:
PROGRAM COUNTER:
2.4.14 Program Counter Memory Indirect Postindexed Mode
This mode is similar to the memory indirect postindexed mode described in 2.4.9 Memory
Indirect Postindexed Mode, but the PC is used as the base register. Both the operand and
operand address are in memory. The processor calculates an intermediate indirect memory
address by adding a base displacement (bd) to the PC contents. The processor accesses a
long word at that address and adds the scaled contents of the index register and the optional
outer displacement (od) to yield the effective address. The value of the PC used in the
calculation is the address of the first extension word. The reference is a program space
reference and is only allowed for reads (refer to 4.2 Address Space Types).
In the syntax for this mode, brackets enclose the values used to calculate the intermediate
memory address. All four user-specified values are optional. However, the user must supply
the assembler notation ZPC (zero value is taken for the PC) to indicate that the PC is not
used. This allows the user to access the program space without using the PC in calculating
the effective address. Both the base and outer displacements may be null, word, or long
word. When a displacement is omitted or an element is suppressed, its value is taken as
zero in the effective address calculation.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER FIELD:
PROGRAM COUNTER:
31
BASE DISPLACEMENT:
310
INDEX REGISTER:
310
OUTER DISPLACEMENT:
EFFECTIVE ADDRESS:
NUMBER OF EXTENSION WORDS: 1,2, 3, 4, OR 5
EA = (bd + PC) + Xn.SIZE*SCALE + od
([bd, PC], Xn.SIZE*SCALE,od)
111
011
SIGN-EXTENDED VALUE
SIGN-EXTENDED VALUE
SIGN-EXTENDED VALUE
310
MEMORY ADDRESS
0
+
310
INDIRECT MEMORY ADDRESS
X
POINTS TO
+
310
VALUE AT INDIRECT MEMORY
ADDRESS IN PROGRAM SPACE
07
SCALE VALUE
+
310
OPERAND
2-18MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
2.4.15 Program Counter Memory Indirect Preindexed Mode
This mode is similar to the memory indirect preindexed mode described in 2.4.10 Memory
Indirect Preindexed Mode, but the PC is used as the base register. Both the operand and
operand address are in memory. The processor calculates an intermediate indirect memory
address by adding the PC contents, a base displacement (bd), and the scaled contents of
an index register. The processor accesses a long word at that address and adds the optional
outer displacement (od) to yield the effective address. The value of the PC is the address of
the first extension word. The reference is a program space reference and is only allowed for
reads (refer to 4.2 Address Space Types).
In the syntax for this mode, brackets enclose the values used to calculate the intermediate
memory address. All four user-specified values are optional. However, the user must supply
the assembler notation ZPC (zero value is taken for the PC) to indicate that the PC is not
used. This allows the user to access the program space without using the PC in calculating
the effective address. Both the base and outer displacements may be null, word, or long
word. When a displacement is omitted or an element is suppressed, its value is taken as
zero in the effective address calculation.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER FIELD:
PROGRAM COUNTER:
310
BASE DISPLACEMENT:
310
INDEX REGISTER
310
OUTER DISPLACEMENT:
NUMBER OF EXTENSION WORDS:
EA = (bd + PC + Xn . SIZE * SCALE) + od
([bd, PC, Xn. SIZE*SCALE],od)
111
011
SIGN-EXTENDED VALUE
SIGN-EXTENDED VALUE
7
SIGN-EXTENDED VALUE
1, 2, 3, 4 OR 5
310
ADDRESS OF EXTENSION WORD
0
SCALE VALUE
310
INDIRECT MEMORY ADDRESS
310
VALUE AT INDIRECT MEMORY
ADDRESS IN PROGRAM SPACE
310
+
X
+
POINTS TO
+
OPERANDEFFECTIVE ADDRESS:
MOTOROLAMC68030 USER’S MANUAL2-19
Data Organization and Addressing Capabilities
2.4.16 Absolute Short Addressing Mode
In this addressing mode, the operand is in memory, and the address of the operand is in the
extension word. The 16-bit address is sign-extended to 32 bits before it is used.
In this mode, the operand is in memory, and the address of the operand occupies the two
extension words following the instruction word in memory. The first extension word contains
the high-order part of the address; the low-order part of the address is the second extension
word.
GENERATION:
ASSEMBLER SYNTAX:
MODE:
REGISTER FIELD:
FIRST EXTENSION WORD:
SECOND EXTENSION WORD:
MEMORY ADDRESS:
NUMBER OF EXTENSION WORDS:
EA GIVEN
(xxx).L
111
001
2
15
ADDRESS HIGH
310
310
0
15
ADDRESS LOW
CONCATENATION
OPERAND
0
2-20MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
2.4.18 Immediate Data
In this addressing mode, the operand is in one or two extension words:
Byte Operation
Operand is in the low-order byte of the extension word
Word Operation
Operand is in the extension word
Long-Word Operation
The high-order 16 bits of the operand are in the first extension word; the low-order 16
bits are in the second extension word.
Coprocessor instructions can support immediate data of any size. The instruction word is
followed by as many extension words as are required.
Generation:Operand given
Assembler Syntax:#xxx
Mode Field:111
Register Field:100
Number of Extension Words:1 or 2, except for coprocessor instructions
MOTOROLAMC68030 USER’S MANUAL2-21
Data Organization and Addressing Capabilities
2.5 EFFECTIVE ADDRESS ENCODING SUMMARY
Most of the addressing modes use one of the three formats shown in Figure 2–4. The single
effective address instruction is in the format of the instruction word. The encoding of the
mode field of this word selects the addressing mode. The register field contains the general
register number or a value that selects the addressing mode when the mode field contains
"111.'' Table 2–2 shows the encoding of these fields. Some indexed or indirect modes use
the instruction word followed by the brief format extension word. Other indexed or indirect
modes consist of the instruction word and the full format of extension words. The longest
instruction for the MC68030 contains 10 extension words. It is a MOVE instruction with full
format extension words for both source and destination effective addresses and with 32-bit
base displacements and 32-bit outer displacements for both addresses. However,
coprocessor instructions can have any number of extension words. Refer to the coprocessor
instruction formats in Section 10 Coprocessor Interface Description.
For effective addresses that use the full format, the index suppress (IS) bit and the index/
indirect selection (I/IS) field determine the type of indexing and indirection. Table 2–1 lists
the indexing and indirection operations corresponding to all combinations of IS and I/IS
values.
Table 2-1. IS–I/IS Memory Indirection Encodings
ISIndex/IndirectOperation
0000No Memory Indirection
0001Indirect Preindexed with Null Outer Displacement
0010Indirect Preindexed with Word Outer Displacement
0011Indirect Preindexed with Long Outer Displacement
0100Reserved
0101Indirect Postindexed with Mull Outer Displacement
0110Indirect Postindexed with Word Outer Displacement
0111Indirect Postindexed with Long Outer Displacement
1000No Memory Indirection
1001Memory Indirect with Mull Outer Displacement
1010Memory Indirect with Word Outer Displacement
1011Memory Indirect with Long Outer Displacement
1100–111Reserved
2-22MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
Single Effective Address Instruction Format
151413121110987650
XXXXXXXXXX
Brief Format Extension Word
15141211109870
D/AREGISTERW/LSCALE0DISPLACEMENT
Full Format Extension Word(s)
1514121110987654320
D/AREGISTERW/LSCALE1BSISBD SIZE0I/IS
BASE DISPLACEMENT (0, 1, OR 2 WORDS)
OUTER DISPLACEMENT (0, 1, OR 2 WORDS)
EFFECTIVE ADDRESS
MODEREGISTER
FieldDefinition FieldDefinition
Instruction:BSBase Register Suppress:
RegisterGeneral Register Number0 = Base Register Added
Extensions:1 = Base Register Suppressed
RegisterIndex Register NumberISIndex Suppress:
D/AIndex Register Type0 = Evaluate and Add Index
0 = DnOperand
1 = An1 = Suppress Index Operand
W/LWord/Long-Word Index SizeBD SIZE Base Displacement Size:
Effective address modes are grouped according to the use of the mode. They can be
classified as follows:
DataA data addressing effective address mode is one that refers to data operands.
MemoryA memory addressing effective address mode is one that refers to memory
operands.
AlterableAn alterable addressing effective address mode is one that refers to alterable
(writable) operands.
ControlA control addressing effective address mode is one that refers to memory
operands without an associated size.
MOTOROLAMC68030 USER’S MANUAL2-23
Data Organization and Addressing Capabilities
Table 2–2 shows the categories to which each of the effective addressing modes belong.
Index (Base Displacement)
Memory Indirect Postindexed
Memory Indirect Preindexed
Absolute Short
Absolute Long
Program Counter Indirect
with Displacement
Program Counter Indirect
with Index (8-Bit) Displacement
Program Counter Indirect
with Index (Base Displacement)
PC Memory Indirect
Postindexed
PC Memory Indirect
Preindexed
Immediate 111 100 X X ——#〈data〉
010
011
100
101
110
110
110
110
111
111
111
111
111
111
111
reg. no
reg. no.
reg. no.
reg. no.
reg. no.
reg. no.
reg. no
reg. no.
000
001
010
011
011
011
011
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
—
—
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
—
—
—
—
—
Assembler
Syntax
(An)
(An)+
-(An)
,An)
(d
16
(d
,An,Xn)
8
(bd,An,Xn)
([bd,An],Xn,od)
([bd,An,Xn],od)
(xxx).W
(xxx).L
,PC)
(d
16
(d8,PC,Xn)
(bd,PC,Xn)
([bd,PC],Xn,od)
([bd,PC,Xn],od)
These categories are sometimes combined, forming new categories that are more
restrictive. Two combined classifications are alterable memory or data alterable. The former
refers to those addressing modes that are both alterable and memory addresses, and the
latter refers to addressing modes that are both data and alterable.
2.6 PROGRAMMER`S VIEW OF ADDRESSING MODES
Extensions to the indexed addressing modes, indirection, and full 32-bit displacements
provide additional programming capabilities for both the MC68020 and the MC68030. This
section describes addressing techniques that exploit these capabilities and summarizes the
addressing modes from a programming point of view.
2-24MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
Several of the addressing techniques described in this section use data registers and
address registers interchangeably. While the MC68030 provides this capability, its
performance has been optimized for addressing with address registers. The performance of
a program that uses address registers in address calculations is superior to that of a
program that similarly uses data registers.The performance has been optimized for
addressing registers in address calculations is superior to that of a program that similarly
uses data registers. The specification of addresses with data registers should be used
sparingly (if at all), particularly in programs that require maximum performance.
2.6.1 Addressing Capabilities
In both the MC68020 and the MC68030, setting the base register suppress (BS) bit in the
full format extension word (see Figure 2–4) suppresses use of the base address register in
calculating the effective address. This allows any index register to be used in place of the
base register. Since any of the data registers can be index registers, this provides a data
register indirect form (Dn). The mode could be called register indirect (Rn) since either a
data register or an address register can be used. This addressing mode is an extension to
the M68000 Family because the MC68030 and MC68020 can use both the data registers
and the address registers to address memory. The capabilities of specifying the size and
scale of an index register (Xn.SIZE*SCALE) in these modes provides additional addressing
flexibility. Using the SIZE parameter, either the entire contents of the index register can be
used, or the least significant word can be sign-extended to provide a 32-bit index value (refer
to Figure 2–5).
D1.L
D1.W
31
0
D1
16 15310
D1
USED IN ADDRESS CALCULATION
Figure 2-5. Using SIZE in the Index Selection
MOTOROLAMC68030 USER’S MANUAL2-25
Data Organization and Addressing Capabilities
For both the MC68020 and the MC68030, the register indirect modes can be extended
further. Since displacements can be 32 bits wide, they can represent absolute addresses or
the results of expressions that contain absolute addresses. This allows the general register
indirect form to be (bd,Rn) or (bd,An,Rn) when the base register is not suppressed. Thus,
an absolute address can be directly indexed by one or two registers (refer to Figure 2–6).
SYNTAX (bd,An,Rn)
bd
An
Rn
Figure 2-6. Using Absolute Address with Indexes
Scaling provides an optional shifting of the value in an index register to the left by zero, one,
two, or three bits before using it in the effective address allocation (the actual value in the
index register remains unchanged). This is equivalent to multiplying the register by one, two,
four, or eight or direct subscripting into an array of elements of corresponding size using an
arithmetic value residing in any of the 16 general registers. Scaling does not add to the
effective address calculation time. However, when combined with the appropriate derived
modes, it produces additional capabilities. Arrayed structures can be addressed absolutely
and then subscripted, (bd,Rn*scale). Another variation that can be derived is (An,Rn*scale).
In the first case, the array address is the sum of the contents of a register and a
displacement, as shown in Figure 2–7. In the second example. An contains the address of
an array and Rn contains a subscript.
2-26MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
SYNTAX: MOVE.W (A5, A6.L*SCALE),(A7)
WHERE:
A5 = ADDRESS OF ARRAY STRUCTURE
A6 = INDEX NUMBER OF ARRAY ITEM
A7 = STACK POINTER
A6 = 1
A6 = 1
SIMPLE ARRAY
(SCALE = 1)
2
3
4
RECORD OF 4 WORDS
(SCALE = 4)
150150
A6 = 1
2
A6 = 1
RECORD OF 2 WORDS
(SCALE = 2)
150150
RECORD OF 8 WORDS
(SCALE = 8)
2
2
NOTE: Regardless of array structure, software increments
index by the appropriate amount to point to next record.
Figure 2-7. Addressing Array Items
MOTOROLAMC68030 USER’S MANUAL2-27
Data Organization and Addressing Capabilities
The memory indirect addressing modes use a long-word pointer in memory to access an
operand. Any of the modes previously described can be used to address the memory
pointer. Because the base and index registers can both be suppressed, the displacement
acts as an absolute address, providing indirect absolute memory addressing (refer to Figure
2–8).
The outer displacement (od) available in the memory indirect modes is added to the pointer
in memory. The syntax for these modes is ([bd,An],Xn,od) and ([bd,An,Xn],od). When the
pointer is the address of a structure in memory and the outer displacement is the offset of
an item in the structure, the memory indirect modes can access the item efficiently (refer to
Figure 2–9).
Memory indirect addressing modes are used with a base displacement in five basic forms:
1. [bd,An] — Indirect, suppressed index register
2. ([bd,An,Xn]) — Preindexed indirect
3. ([bd,An],Xn) — Postindexed indirect
4. ([bd,An,Xn],od) — Preindexed indirect with outer displacement
5. ([bd,An],Xn,od) — Postindexed indirect with outer displacement
SYNTAX: ([bd])
bd
POINTERDATA ITEM
Figure 2-8. Using Indirect Absolute Memory Addressing
The indirect, suppressed index register mode (see Figure 2–10) uses the contents of
register An as an index to the pointer located at the address specified by the displacement.
The actual data item is at the address in the selected pointer.
The preindexed indirect mode (see Figure 2–11) uses the contents of An as an index to the
pointer list structure at the displacement. Register Xn is the index to the pointer, which
contains the address of the data item.
2-28MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
SYNTAX: ([An],od)
MEMORYSTRUCTURE
An
POINTER
od
DATA ITEM
Figure 2-9. Accessing an Item in a Structure Using a Pointer
SYNTAX: ([bd,An])
POINTER LIST
bd
An
POINTER
DATA ITEM
Figure 2-10. Indirect Addressing, Suppressed Index Register
MOTOROLAMC68030 USER’S MANUAL2-29
Data Organization and Addressing Capabilities
POINTER LIST
SYNTAX: ([bd,An,Xn])
bd
An
DATA ITEM
Xn
POINTER
Figure 2-11. Preindexed Indirect Addressing
2-30MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
The postindexed indirect mode (see Figure 2–12) uses the contents of An as an index to the
pointer list at the displacement. Register Xn is used as an index to the structure of data items
located at the address specified by the pointer. Figure 2–13 shows the preindexed indirect
addressing with outer displacement mode.
SYNTAX: ([bd,An],Xn)
bd
bd
POINTER LIST
An
POINTER
POSTINDEXED STRUCTURE
Xn
DATA ITEM
Figure 2-12. Postindexed Indirect Addressing
SYNTAX: ([bd,An,Xn],od)
POINTER LIST
An
STRUCTURE
od
Xn
POINTER
DATA ITEM
Figure 2-13. Preindexed Indirect Addressing with Outer Displacement
MOTOROLAMC68030 USER’S MANUAL2-31
Data Organization and Addressing Capabilities
The postindexed indirect mode with outer displacement (see Figure 2–14) uses the contents
of An as an index to the pointer list at the displacement. Register Xn is used as an index to
the structure of data structures at the address in the pointer. The outer displacement (od) is
the displacement of the data item within the selected data structure.
SYNTAX: ([bd,An],Xn,od)
POINTER LIST
bd
An
POINTER
POSTINDEXED STRUCTURE
WITH OUTER DISPLACEMENT
od
Xn
DATA ITEM
Figure 2-14. Postindexed Indirect Addressing with Outer Displacement
2.6.2 General Addressing Mode Summary
The addressing modes described in the previous section are derived from specific
combinations of options in the indexing mode or a selection of two alternate addressing
modes. For example, the addressing mode called register indirect (Rn) assembles as the
address register indirect if the register is an address register. If Rn is a data register, the
assembler uses the address register indirect with index mode using the data register as the
indirect register and suppresses the address register by setting the base suppress bit in the
effective address specification. Assigning an address register as Rn provides higher
performance than using a data register as Rn. Another case is (bd,An), which selects an
addressing mode depending on the size of the displacement. If the displacement is 16 bits
or less, the address register indirect with displacement mode (d
bit displacement is required, the address register indirect with index (bd,An,Xn) is used with
the index register suppressed.
,An) is used. When a 32-
16
2-32MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
It is useful to examine the derived addressing modes available to a programmer (without
regard to the MC68030 effective addressing mode actually encoded) because the
programmer need not be concerned about these decisions. The assembler can choose the
more efficient addressing mode to encode.
In the list of derived addressing modes that follows, common programming terms are used.
The following definitions apply:
pointer—long-Word value in a register or in memory which represents an
address.
base— A pointer combined with a displacement to represent an address.
index—A constant or variable value added into an effective address calcula-
tion. A constant index is a displacement. A variable index is always
represented by a register containing the value.
disp— Displacement, a constant index.
subscript—The use of any of the data or address registers as a variable index
subscript into arrays of items 1, 2, 4 or 8 bytes in size.
relative— An address calculated from the program counter contents. The
address is position independent and is in program space. All other
addresses but psaddr are in data space.
addr— An absolute address.
psaddr—An absolute address in program space. All other addresses but PC
relative are in data space.
preindexed— All modes from absolute address through program counter relative.
postindexed—Any of the following modes:
addr—Absolute address in data space
psaddr,ZPC— Absolute address in program space
An—Register pointer with constant displacement
disp.An— Register pointer with constant displacement
addr,An— Absolute address with single variable name
disp,Pc— Simple PC relative
The addressing modes defined in programming terms, which are derivations of the
addressing modes provided by the MC68030 architecture, are as follows:
Immediate Data — #data:
The data is a constant located in the instruction stream.
Register Direct — Rn:
The contents of a register contain the operand.
Scanning Modes:
(An)+
MOTOROLAMC68030 USER’S MANUAL2-33
Data Organization and Addressing Capabilities
Address register pointer automatically incremented after use.
– (An)
Address register pointer automatically decremented before use.
Absolute Address:
(addr)
Absolute address in data space.
(psaddr,ZPC)
Absolute address in program space. Symbol ZPC suppresses the PC,
but retains PC relative mode to directly access the program space.
Register Pointer:
(Rn)
Register as a pointer.
(disp,Rn)
Register as a pointer with constant index (or base address).
Indexing
(An,Rn)
Register pointer An with variable index Rn.
(disp,An,Rn)
Register pointer with constant and variable index (or a base address
with a variable index).
(addr,Rn)
Absolute address with two variable indexes.
Subscripting:
(An,Rn*scale)
Address register pointer subscript.
(disp,An,Rn*scale)
Address register pointer subscript with constant displacement
(or base address with subscript).
(addr,Rn*scale)
Absolute address with subscript.
(addr,An,Rn*scale)
Absolute address subscript with variable index.
Program Relative:
2-34MC68030 USER’S MANUALMOTOROLA
(disp,PC)
Simple PC relative.
(disp,PC,Rn)
PC relative with variable index.
(disp,PC,Rn*scale)
PC relative with subscript.
Memory Pointer:
([preindexed])
Memory pointer directly to data operand.
([preindexed],disp)
Memory pointer as base with displacement to data operand.
([postindexed],Rn)
Data Organization and Addressing Capabilities
Memory pointer with variable index.
([postindexed],disp,Rn)
Memory pointer with constant and variable index.
([postindexed],Rn*scale)
Memory pointer subscripted.
([postindexed],disp,Rn*scale)
Memory pointer subscripted with constant index.
MOTOROLAMC68030 USER’S MANUAL2-35
Data Organization and Addressing Capabilities
2.7 M68000 FAMILY ADDRESSING COMPATIBILITY
Programs can be easily transported from one member of the M68000 Family to another in
an upward compatible fashion. The user object code of each early member of the family is
upward compatible with newer members and can be executed on the newer microprocessor
without change. The address extension word(s) are encoded with the information that allows
the MC68020/MC68030 to distinguish the new address extension words for the early
MC68000/MC68008/MC68010 microprocessors and for the newer 32-bit MC68020/
MC68030 microprocessors are shown in Figure 2–15. Notice the encoding for SCALE used
by the MC68020/MC68030 is a compatible extension of the M68000 architecture. A value
of zero for SCALE is the same encoding for both extension words; hence, software that uses
this encoding is both upward and downward compatible across all processors in the product
line. However, the other values of SCALE are not found in both extension formats; thus,
while software can be easily migrated in an upward compatible direction, only nonscaled
addressing is supported in a downward fashion. If the MC68000 were to execute an
instruction that encoded a scaling factor, the scaling factor would be ignored and not access
the desired memory address. The earlier microprocessors have no knowledge of the
extension word formats implemented by newer processors; while they do detect illegal
instructions, they do not decode invalid encodings of the extension words as exceptions.
2.8 OTHER DATA STRUCTURES
Stacks and queues are widely used data structures. The MC68030 implements a system
stack and also provides instructions that support the use of user stacks and queues.
2.8.1 System Stack
Address register seven (A7) is used as the system stack pointer (SP). Any of the three
system stack registers is active at any one time. The M and S bits of the status register
determine which stack pointer is used. When S = 0 indicating user mode (user privilege
level), the user stack pointer (USP) is the active system stack pointer, and the master and
interrupt stack pointers cannot be referenced. When S = 1 indicating supervisor mode (at
supervisor privilege level) and M = 1, the master stack pointer (MSP) is the active system
stack pointer. When S = 1 and M = 0, the interrupt stack pointer (ISP) is the active system
stack pointer. This mode is the MC68030 default mode after reset and corresponds to the
MC68000, MC68008, and MC68010 supervisor mode. The term supervisor stack pointer
(SSP) refers to the master or interrupt stack pointers, depending on the state of the M bit.
When M = 1, the term SSP (or A7) refers to the MSP address register. When M = 0, the term
is implicitly referenced by all instructions that use the system stack. Each system stack fills
from high to low memory.
2-36MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
(UNABLE TO LOCATE ART. MUST BE RECREATED.)
Figure 2-15. M68000 Family Address Extension Words
A subroutine call saves the program counter on the active system stack, and the return
restores it from the active system stack. During the processing of traps and interrupts, both
the program counter and the status register are saved on the supervisor stack (either master
or interrupt). Thus, the execution of supervisor code is independent of user code and the
condition of the user stack; conversely, user programs use the user stack pointer
independently of supervisor stack requirements.
To keep data on the system stack aligned for maximum efficiency, the active stack pointer
is automatically decremented or incremented by two for all byte-sized operands moved to
or from the stack. In long-word-organized memory, aligning the stack pointer on a long-word
address signed significantly increases the efficiency of stacking exception frames,
subroutine calls and returns, and other stacking operations.
MOTOROLAMC68030 USER’S MANUAL2-37
Data Organization and Addressing Capabilities
2.8.2 User Program Stacks
The user can implement stacks with the address register indirect with postincrement and
predecrement addressing modes. With address register An (n = 0–6), the user can
implement a stack that is filled wither from high to low memory or from low to high memory.
Important considerations are:
• Use the predecrement mode to decrement the register before its contents are used as
the pointer to the stack.
• Use the postincrement mode to increment the register after its contents are used as the
pointer to the stack.
• Maintain the stack pointer correctly when byte, word, and long-word items are mixed in
these stacks.
To implement stack growth from high to low memory, use:
–(An) to push data on the stack,
(An)+ to pull data from the stack.
For this type of stack, after either a push or a pull operation, register An points to the top item
on the stack. This is illustrated as:
LOW MEMORY
An
(FREE)
TOP OF STACK
BOTTOM OF STACK
HIGH MEMORY
To implement stack growth from low to high memory, use:
(An)+ to push data on the stack,
–An to pull data from the stack.
2-38MC68030 USER’S MANUALMOTOROLA
Data Organization and Addressing Capabilities
In this case, after either a push or pull operation, register An points to the next available
space on the stack. This is illustrated as:
LOW MEMORY
BOTTOM OF STACK
TOP OF STACK
An
(FREE)
HIGH MEMORY
2.8.3 Queues
The user can implement queues with the address register indirect with postincrement or
predecrement addressing modes. Using a pair of address registers (who of A0–A6), the user
can implement a queue which is filled either from high to low memory or from low to high
memory. Two registers are used because queues are pushed from one end and pulled from
the other. One register, An, contains the "put'' pointer; the other, Am, the "get'' pointer.
To implement growth of the queue from low to high memory, use:
(An)+ to put data into the queue,
(Am)+ to get data from the queue.
After a "put'' operation, the "put'' address register points to the next available space in the
queue, and the unchanged "get'' address register points to the next item to be removed from
the queue. After a "get'' operation, the "get'' address register points to the next item to be
removed from the queue, and the unchanged "put'' address register points to the next
available space in the queue. This is illustrated as:
LOW MEMORY
LAST GET (FREE)
GET (Am) +
PUT (An) +
NEXT GET
LAST PUT
(FREE)
HIGH MEMORY
To implement the queue as a circular buffer, the relevant address register should be
checked and adjusted, if necessary, before performing the "put'' or "get'' operation. The
address register is adjusted by subtracting the buffer length (in bytes) from the register.
MOTOROLAMC68030 USER’S MANUAL2-39
Data Organization and Addressing Capabilities
To implement growth of the queue from high to low memory, use:
–(An) to put data into the queue,
–(Am) to get data from the queue.
After a "put'' operation, the "put'' address register points to the last item place din the queue,
and the unchanged "get'' address register points to the last item removed from the queue.
After a "get'' operation, the "get'' address register points to the last item removed from the
queue, and the unchanged "put'' address register points to the last item placed in the queue.
This is illustrated as:
LOW MEMORY
(FREE)
PUT - (An)
GET - (Am)
LAST PUT
NEXT GET
LAST GET (FREE)
HIGH MEMORY
To implement the queue as a circular buffer, the "get'' or "put'' operation should be
performed first, and then the relevant address register should be checkout and adjusted, if
necessary. The address register is adjusted by adding the buffer length (in bytes) to the
register contents.
2-40MC68030 USER’S MANUALMOTOROLA
SECTION 3
INSTRUCTION SET SUMMARY
This section briefly describes the MC68030 instruction set. Refer to the MC68000PM/AD,
MC68000 Programmer's Reference Manual
instruction set.
The following paragraphs include descriptions of the instruction format and the operands
used by instructions, followed by a summary of the instruction set. The integer condition
codes and floating-point details are discussed. Programming examples for selected
instructions are also presented.
, for complete details on the MC68030
3.1 INSTRUCTION FORMAT
All MC68030 instructions consist of at least one word; some have as many as 11 words (see
Figure 3–1). The first word of the instruction, called the operation word, specifies the length
of the instruction and the operation to be performed. The remaining words, called extension
words, further specify the instruction and operands. These words may be floating-point
command words, conditional predicates, immediate operands, extensions to the effective
address mode specified in the operation word, branch displacements, bit number or bit field
specifications, special register specifications, trap operands, pack/unpack constants, or
argument counts.
15 0
OPERATION WORD(ONE WORD,
SPECIFIES OPERATION AND MODES)
SPECIAL OPERAND SPECIFIERS
(IF ANY, ONE OR TWO WORDS)
IMMEDIATE OPERAND OR SOURCE EFFECTIVE ADDRESS EXTENSION(
IF ANY, ONE TO SIX WORDS)
DESTINATION EFFECTIVE ADDRESS EXTENSION
(IF ANY, ONE TO SIX WORDS)
Figure 3-1. Instruction Word General Format
MOTOROLA
MC68030 USER’S MANUAL
3-1
Instruction Set Summary
Besides the operation code, which specifies the function to be performed, an instruction
defines the location of every operand for the function. Instructions specify an operand
location in one of three ways:
1. Register Specification — A register field of the instruction contains the number of the
register.
2. Effective Address — An effective address field of the instruction contains address
mode information.
3. Implicit Reference — The definition of an instruction implies the use of specific regis-
ters.
The register field within an instruction specifies the register to be used. Other fields within
the instruction specify whether the register selected is an address or data register and how
the register is to be used. Section 1 Introduction contains register information.
Effective address information includes the registers, displacements, and absolute
addresses for the effective address mode. Section 2 Data Organization and Addressing
Capabilities describes the effective address modes in detail.
Certain instructions operate on specific registers. These instructions imply the required
registers.
3.2 INSTRUCTION SUMMARY
The instructions form a set of tools to perform the following operations:
Data Movement
Integer Arithmetic
Logical
Shift and Rotate
Bit Manipulation
Each instruction type is described in detail in the following paragraphs
Bit Field Manipulation
Binary-Coded Decimal Arithmetic
Program Control
System Control
Multiprocessor Communications
3-2
MC68030 USER’S MANUAL
MOTOROLA
〈 ea 〉
Instruction Set Summary
The following notations are used in this section. In the operand syntax statements of the
instruction definitions, the operand on the right is the destination operand.
An = any address register, A7–A0
Dn = any data register, D7–D0
Rn = any address or data register
CCR = condition code register (lower byte of status register)
cc = condition codes from CCR
SR = status register
SP = active stack pointer
USP = user stack pointer
ISP = supervisor/interrupt stack pointer
MSP = supervisor/master stack pointer
SSP = supervisor (master or interrupt) stack pointer
DFC = destination function code register
SFC = source function code register
Rc = control register (VBR, SFC, DFC, CACR)
= MMU control register (SRP, URP, TC, DTT0, DTT1, ITT0,
MRc
ITT1, MMUSR)
MMUSR = MMU status register
B, W, L = specifies a signed integer data type (twos complement) of
byte, word, or long word
S = single-precision real data format (32 bits)
D = double-precision real data format (64 bits)
X = extended-precision real data format (96 bits, 16 bits unused)
P = packed BCD real data format (96 bits, 12 bytes)
FPm, FPn = any floating-point data register, FP7-FP0
= floating-point system control register (FPCR, FPSR, or
PFcr
FPIAR)
k = a twos-complement signed integer (–64 to +17) that specifies
the format of a number to be stored in the packed BCD format
= displacement; d
d
is a 16-bit displacement
16
= effective address
list = list of registers, for example D3 — D0
# 〈 data 〉 = immediate data; a literal integer
{offset:width} = bit field selection
label = assemble program label
[m] = bit m of an operand
[m:n] = bits m through n of operand
MOTOROLA
MC68030 USER’S MANUAL
3-3
÷
Λ
⊕
Instruction Set Summary
X = extend (X) bit in CCR
N = negative (N) bit in CCR
Z = Zero (Z) bit in CCR
V = overflow (V) bit in CCR
C = carry (C) bit in CCR
+ = arithmetic addition or postincrement indicator
– = arithmetic subtraction or predecrement indicator
~ = invert; operand is logically complemented
V = logical OR
Dc = data register, D7-D0 used during compare
Du = data register, D7-D0 used during update
Dr, Dq = data registers, remainder or quotient of divide
Dh, Dl = data registers, high or lo • order 32 bits of product
MSW = most significant word
LSW = least significant word
MSB = most significant bit
FC = function code
{R/W} = read or write indicator
[An] = address extensions
x = arithmetic multiplication
= arithmetic division or conjunction symbol
= logical AND
= logical exclusive OR
3.2.1 Data Movement Instructions
The MOVE instructions with their associated addressing modes are the basic means of
transferring and storing addresses and data. MOVE instructions transfer byte, word, and
long-word operands from memory to memory, memory to register, register to memory, and
register to register. Address movement instructions (MOVE or MOVEA) transfer word and
long-word operands and ensure that only valid address manipulations are executed. In
addition to the general MOVE instructions, there are several special data movement
instructions: move multiple registers (MOVEM), move peripheral data (MOVEP), move
quick (MOVEQ), exchange registers (EXG), load effective address (LEA), push effective
address (PEA), link stack (LINK), and unlink stack (UNLK).
3-4
MC68030 USER’S MANUAL
MOTOROLA
〈 ea 〉
〈 ea 〉 , 〈 ea 〉
〈 ea 〉
〈 ea 〉 →
Instruction Set Summary
Table 3–1 is a summary of the integer and floating-point data movement operations.
Table 3-1. Data Movement Operations
InstructionOperand SyntaxOperand SizeOperation
EXG Rn,Rn 32 Rn ↔ Rn
LEA
LINK An,#
MOVE
MOVEA
MOVEM list,
MOVEP
MOVEQ #
PEA
UNLK An 32 An
,An 32
〈
d
〉
,An 8, 16, 32
〈
ea
〉
,list 16, 32
Dn,(d
(d
,An)
16
,An),Dn
16
〈
data
〉
,Dn8
An
16, 32 Sp - 4 → SP; An → (SP); SP → An, SP + D → SP
source → destination
16, 32 → 32
listed registers → destination
16, 32 → 32
16, 32
→
32immediate data → destination
32 SP — 4 → SP; 〈 ea 〉 → (SP)
source → listed registers
Dn[31:24] → (An + d); Dn[23:16] → An + d + 2);
Dn[15:8] → (An + d + 4); Dn[7:0] → (An + d + 6)
(An + d) → Dn[31:24]; (An + d + 2) → Dn[23:16];
(An + d + 4) → Dn[15:8]; (An + d + 6) → Dn[7:0]
→
SP; (SP) → An; SP + 4 → SP
3.2.2 Integer Arithmetic Instructions
The integer arithmetic operations include the four basic operations of add (ADD), subtract
(SUB), multiply (MUL), and divide (DIV) as well as arithmetic compare (CMP, CMPM,
CMP2), clear (CLR), and negate (NEG). The instruction set includes ADD, CMP, and SUB
instructions for both address and data operations with all operand sizes valid for data
operations. Address operands consist of 16 or 32 bits. The clear and negate instructions
apply to all sizes of data operands.
Signed and unsigned MUL and DIV instructions include:
• Word multiply to produce a long-word product
• Long-word multiply to produce and long-word or quad-word product
• Division of a long word divided by a word divisor (word quotient and word remainder)
• Division of a long word or quad word dividend by a long-word divisor (long-word quotient and long-word remainder)
A set of extended instructions provides multiprecision and mixed-size arithmetic. These
instructions are add extended (ADDX), subtract extended (SUBX), sign extended (EXT),
and negate binary with extend (NEGX). Refer to Table 3–2 for a summary of the integer
arithmetic operations.
destination/source → destination (signed or unsigned)
sign-extended destination → destination
source y destination → destination (signed or unsigned)
destination = source → destination
destination - immediate data → destination
destination - source — X → destination
〈 ea 〉
〈 ea 〉
〈 ea 〉
〈 ea 〉
〈 ea 〉
〈 ea 〉
〈
3.2.3 Logical Instructions
The logical operation instructions (AND, OR, EOR, and NOT) perform logical operations
with all sizes of integer data operands. A similar set of immediate instructions (ANDI, ORI,
and EORI) provide these logical operations with all sizes of immediate data. The TST
instruction compares the operand with zero arithmetically, placing the result in the condition
code register. Table 3–3 summarizes the logical operations.
3-6
MC68030 USER’S MANUAL
MOTOROLA
Instruction Set Summary
Table 3-3. Logical Operations
InstructionOperand SyntaxOperand SizeOperation
AND 〈ea〉,Dn
Dn,〈ea〉
ANDI #〈data〉,〈ea〉 8, 16, 32 immediate data Λ destination → destination
EOR Dn,〈data〉,〈ea〉 8, 16, 32 source ⊕ destination → destination
EORI #〈data〉,〈ea〉 8, 16, 32 immediate data x destination → destination
NOT 〈ea〉 8, 16, 32 ∼ destination → destination
OR 〈ea〉,Dn
Dn,〈ea〉
ORI #〈data〉,〈ea〉 8, 16, 32 immediate data V destination → destination
TST #〈ea〉 8, 16, 32 source — 0 to set condition codes
8, 16, 32
8, 16, 32
8, 16, 32
8, 16, 32
source Λ destination → destination
source V destination → destination
3.2.4 Shift and Rotate Instructions
The arithmetic shift instructions (ASR and ASL) and logical shift instructions (LSR and LSL)
provide shift operations in both directions. The ROR, ROL, ROXR, and ROXL instructions
perform rotate (circular shift) operations, with and without the extend bit. All shift and rotate
operations can be performed on either registers or memory.
Register shift and rotate operations shift all operand sizes. The shift count may be specified
in the instruction operation word (to shift from 1–8 places) or in a register (modulo 64 shift
count).
Memory shift and rotate operations shift word-length operands one bit position only. The
SWAP instruction exchanges the 16-bit halves of a register. Performance of shift/rotate
instructions is enhanced so that use of the ROR and ROL instructions with a shift count of
eight allows fast byte swapping. Table 3–4 is a summary of the shift and rotate operations.
MOTOROLAMC68030 USER’S MANUAL3-7
Instruction Set Summary
Table 3-4. Shift and Rotate Operations.
X/C
X/C0
C
0
X/C
X/C0
C
XC
XC
MSWLSW
3.2.5 Bit Manipulation Instructions
Bit manipulation operations are accomplished using the following instructions: bit test
(BTST), bit test and set (BSET), bit test and clear (BCLR), and bit test and change (BCHG).
All bit manipulation operations can be performed on either registers or memory. The bit
number is specified as immediate data or in a data register. Register operands are 32 bits
long, and memory operands are 8 bits long. In Table 3–5, the summary of the bit
manipulation operations, Z refers to bit 2, the zero bit of the status register.
3-8MC68030 USER’S MANUALMOTOROLA
Instruction Set Summary
Table 3-5. Bit Manipulation Operations
Instruction Operand Syntax Operand Size Operation
BCHG Dn,〈ea〉
#〈data〉,ea
BCLR Dn,〈ea〉
#〈data〉,ea
BSET Dn,〈ea〉
#〈data〉,〈ea〉
BTST Dn,〈ea〉
#〈data〉,ea
8, 32
8, 32
8, 32
8, 32
8, 32
8, 32
8, 32
8, 32
∼ (〈bit number〉 of destination) → Z → bit of destination
∼ (〈bit number〉 of destination) → Z;
— 0 → bit of destination
∼ (〈bit number〉 of destination) → Z;
— 1 → bit of destination
∼ (〈bit number〉 of destination) → Z
3.2.6 Bit Field Operations
The MC68030 supports variable-length bit field operations on fields of up to 32 bits. The bit
field insert (BFINS) instruction inserts a value into a bit field. Bit field extract unsigned
(BFEXTU) and bit field extract signed (BFEXTS) extract a value from the field. Bit field find
first one (BFFFO) finds the first bit that is set in a bit field. Also included are instructions that
are analogous to the bit manipulation operations; bit field test (BFTST), bit field test and set
(BFSET), bit field test and clear (BFCLR), and bit field test and change (BFCHG). Table 3–
6 is a summary of the bit field operations.
Table 3-6. Bit Field Operations
Instruction Operand Syntax Operand SizeOperation
BFCHG〈ea〉 {offset:width}1 — 32∼ Field → Field
BFCLR〈ea〉 {offset:width}1 — 320's → Field
BFEXTS〈ea〉 {offset:width},Dn1—32Field → Dn; Sign Extended
BFEXTU〈ea〉 {offset:width},Dn1 — 32Field → Dn; Zero Extended
BFFFO〈ea〉 {offset:width},Dn1 — 32Scan for first bit set in field; offset → Dn
BFINSDn,〈ea〉 {offset:width}1 — 32Dn → Field
BFSET〈ea〉 {offset:width}1 — 321's → Field
BFTST〈ea〉 {offset:width}1 — 32Field MSB → N; ∼ (OR of all bits in field) → Z
NOTE: All bit field instructions set the N and Z bits as shown for BFTST before performing the specified operation.
MOTOROLAMC68030 USER’S MANUAL3-9
Instruction Set Summary
3.2.7 Binary–coded Decimal Instructions
Five instructions support operations on binary-coded decimal (BCD) numbers. The
arithmetic operations on packed BCD numbers are add decimal with extend (ABCD),
subtract decimal with extend (SBCD), and negate decimal with extend (NBCD). PACK and
UNPACK instructions aid in the conversion of byte encoded numeric data, such as ASCII or
EBCDIC strings, to BCD data and vice versa. Table 3–7 is a summary of the BCD
operations.
A set of subroutine call and return instructions and conditional and unconditional branch
instructions perform program control operations. The no operation instruction (NOP) may be
used to force synchronization of the internal pipelines. Table 3–8 summarizes these
instructions.
Table 3-8. Program Control Operations
InstructionOperand SyntaxOperand SizeOperation
Integer and Floating-Point Conditional
Bcc 〈label〉 8, 16, 32 if condition true, then PC + d → PC
DBcc Dn,〈label〉 16 if condition false, then Dn — 1 → Dn
if Dn ≠ -1, then PC + d → PC
Scc 〈ea〉 8 if condition true, then 1's → destination;
else 0's → destination
Unconditional
BRA 〈label〉 8, 16, 32 PC + d → PC
BSR 〈label〉 8, 16, 32 SP — 4 → SP; PC→(SP); PC + d → PC
JMP 〈ea〉 none destination → PC
JSR 〈ea〉 none SP — 4 → SP; PC→ (SP); destination → PC
NOP none none PC + 2 → PC
Letters cc in the integer instruction mnemonics Bcc, DBcc, and Scc specify testing one of the following conditions:
CC—Carry clearGE—Greater or equal
LS—Lower or samePL—Plus
CS—Carry setGT—Greater than
LT—Less thanT—Always true*
EQ—EqualHI—Higher
MI—MinusVC—Overflow clear
F—Never true*LE—-Less or equal
NE—Not equalVS—Overflow set
*Not applicable to the Bcc instructions.
MOTOROLAMC68030 USER’S MANUAL3-11
Instruction Set Summary
3.2.9 System Control Instructions
Privileged instructions, trapping instructions, and instructions that use or modify the
condition code register (CCR) provide system control operations. Table 3–9 summarizes
these instructions. The TRAPcc instruction uses the same conditional tests as the
corresponding program control instructions. All of these instructions cause the processor to
flush the instruction pipe.
Table 3-9. System Control Operations
InstructionOperand SyntaxOperand SizeOperation
Privileged
ANDI #〈data〉,SR 16 immediate data Λ SR → SR
EORI #〈data〉,SR 16 immediate data x SR → SR
MOVE 〈ea〉,SR
SR,〈ea〉
MOVE USP,An
An,USP
MOVEC Rc,Rn
Rn,Rc
MOVES Rn, 〈ea〉
〈ea〉,Rn
ORI #〈data〉,SR 16 immediate data V SR → SR
RESET nonenoneassert RESET
RTE none none (SP) → SR; SP + 2 → SP; (SP) → PC; SP + 4 → SP;
STOP #〈data〉 16 immediate data → SR; STOP
BKPT #〈data〉 none run breakpoint cycle, then trap as illegal instruction
CHK 〈ea〉,Dn 16, 32 if Dn < 0 or Dn > (ea), then CHK exception
CHK2 〈ea〉,Rn 8, 16, 32 if Rn < -lower bound or Rn > -upper bound, then CHK
The PFLUSH instructions flush the address translation caches (ATCs) and can optionally
select only nonglobal entries for flushing. PTEST performs a search of the address
translation tables, storing results in the MMU status register and loading the entry into the
ATC. Table 3–10 summarizes these instructions.
Table 3-10. MMU Instructions
InstructionOperand SyntaxOperand SizeOperation
PFLUSHAnonenoneInvalidate all ATC entries
PFLUSHA.NnonenoneInvalidate all nonglobal ATC entries
PFLUSH(An)noneInvalidate ATC entries at effective address
PFLUSH.N(An)noneInvalidate nonglobal ATC entries at effective address
PTEST(An)noneInformation about logical address → MMU status register
3.2.11 Multiprocessor Instructions
The TAS, CAS, and CAS2 instructions coordinate the operations of processors in
multiprocessing systems. These instructions use read-modify-write bus cycles to ensure
uninterrupted updating of memory. Coprocessor instructions control the coprocessor
operations. Table 3–11 lists these instructions.
CAS Dc,Du,〈ea〉8, 16, 32 destination — Dc → CC; if Z then Du → destination
else destination→Dc
CAS2 Dc1:Dc2,Du1:Du2,(
Rn):(Rn)
TAS 〈ea〉 8 destination — 0; set condition codes; 1 → destination [7]
cpBcc 〈label〉 16, 32 if cpcc true, then PC + d → PC
cpDBcc label,Dn 16 if cpcc false then Dn –1 → Dn
cpGEN User Defined User Defined operand → coprocessor
cpRESTORE 〈ea〉 none restore coprocessor state from 〈ea〉
cpSAVE 〈ea〉 none save coprocessor state at 〈ea〉
cpScc 〈ea〉 8 if cpcc true, then 1's → destination; else 0's → destination
cpTRAPcc none
#〈data〉
8, 16, 32 dual operand CAS
Coprocessor
if Dn ≠ –1, then PC + d → PC
none
16, 32
if cpc true, then TRAPcc exception
MOTOROLAMC68030 USER’S MANUAL3-13
Instruction Set Summary
3.3 INTEGER CONDITION CODES
The CCR portion of the SR contains five bits which indicate the results of many integer
instructions. Program and system control instructions use certain combinations of these bits
to control program and system flow.
The first four bits represent a condition resulting from a processor operation. The X bit is an
operand for multiprecision computations; when it is used, it is set to the value of the C bit.
The carry bit and the multiprecision extend bit are separate in the M68000 Family to simplify
programming techniques that use them (refer to Table 3–8 as an example).
The condition codes were developed to meet two criteria:
• Consistency across instructions, uses, and instances
• Meaningful Results no change unless it provides useful information
Consistency across instructions means that all instructions that are special cases of more
general instructions affect the condition codes in the same way. Consistency across
instances means that all instances of an instruction affect the condition codes in the same
way. Consistency across uses means that conditional instructions test the condition codes
similarly and provide the same results, regardless of whether the condition codes are set by
a compare, test, or move instruction.
In the instruction set definitions, the CCR is shown as follows:
XNZVC
where:
X (extend)
Set to the value of the C bit for arithmetic operations. Otherwise not affected or set to
a specified result.
N (negative)
Set if the most significant bit of the result is set. Cleared otherwise.
Z (zero)
Set if the result equals zero. Cleared otherwise.
V (overflow)
Set if arithmetic overflow occurs. This implies that the result cannot be represented in
the operand size. Cleared otherwise.
C (carry)
Set if a carry out of the most significant bit of the operand occurs for an addition. Also
set if a borrow occurs in a subtraction. Cleared otherwise.
3-14MC68030 USER’S MANUALMOTOROLA
Instruction Set Summary
3.3.1 Condition Code Computation
Most operations take a source operand and a destination operand, compute, and store the
result in the destination location. Single-operand operations take a destination operand,
compute, and store the result in the destination location. Table 3–12 lists each instruction
and how it affects the condition code bits.
Table 3-12. Condition Code Computations (Sheet 1 of 2)
OperationsXNZVCSpecial Definition
ABCD*U ?U ? C =-Decimal Carry
Z =-Z Λ Rm Λ . . . Λ R0
ADD, ADDI, ADDQ * * * ? ? V = Sm Λ Dm Λ Rm V Sm Λ Dm Λ Rm
C = Sm Λ Dm V Rm Λ Dm V Sm Λ Rm
ADDX * * ? ? ? V = Sm Λ Dm Λ Rm V Sm Λ Dm Λ Rm
C = Sm Λ Dm V Rm Λ Dm V Sm Λ Rm
Z = Z Λ Rm
AND, ANDI, EOR, EORI,
MOVEQ, MOVE, OR, ORI
CLR, EXT, NOT, TAS, TST
CHK— *UUU
CHK2, CMP2— U ?U ? Z = (R = LB) V (R = UB)
SUB, SUBI, SUBQ * * * ? ? V = Sm Λ Dm
SUBX * * ? ? ? V = Sm Λ Dm Λ Rm V Sm Λ Dm Λ Rm
CAS, CAS2, CMP, CMPI,
CMPM
DIVS, DUVI — * * ? 0 V = Division Overflow
MULS, MULU — * * ? 0 V = Multiplication Overflow
SBCD, NBCD * U U ? C = Decimal Borrow
NEG * * * ? ? V = Dm Λ Rm
NEGX * * ? ? ? V = Dm Λ Rm
— * * 0 0
C = (LB < = UB) Λ (IR < LB) V (R > UB))
V = (UB <LB) Λ (R >UB) Λ (R <LB)
C = Sm Λ Dm V Rm Λ Dm V Sm Λ Rm
C = Sm Λ Dm V Rm Λ Dm V Sm Λ Rm
Z = Z Λ Rm Λ . . . Λ R0
ASL (R = 0)**00
LSL, ROXL***0 ? C = Dm –r + 1
LSR (r = 0) —**00
ROXL (r = 0) —**0 ? C = X
ROL —**0 ? C = Dm –r + 1
ROL (r = 0) —**00
ASR, LSR, ROXR***0 ? C = Dr –1
ASR, LSR (r = 0) —**00
ROXR (r = 0) —**0 ? C = X
ROR —**0 ? C = Dr –1
ROR (r = 0) — **00
—=Not AffectedRm = Result Operand — Most Significant Bit
U=Undefined, Result Meaningless R = Register Tested
?=Other — See Special Definition n = Bit Number
*=General Caser = Shift Count
X = CLB = Lower Bound
N = RmUB = Upper Bound
Z = Rm
Λ . . . Λ R0Λ = Boolean AND
Sm=Destination Operand — Most Significant BitV = Boolean OR
Dm=Destination Operand — Most Significant BitRm
— ? ?00 N = Dm
Z = Dm
Z = Sm
Z = Dm
(Dm
C = Dm –r + 1
Λ DM –1 Λ . . . Λ D0
Λ Sm –1 Λ . . . Λ S0
Λ DM–1 Λ . . . Λ D0
–1 V . . . + Dm –r)
= NOT Rm
3-16MC68030 USER’S MANUALMOTOROLA
Instruction Set Summary
3.3.2 Conditional Tests
Table 3–13 lists the condition names, encodings, and tests for the conditional branch and
set instructions. The test associated with each condition is a logical formula using the current
states of the condition codes. If this formula evaluates to one, the condition is true. If the
formula evaluates to zero, the condition is false. For example, the T condition is always true,
and the EQ condition is true only if the Z bit condition code is currently true.
Table 3-13. Conditional Tests
MnemonicConditionEncodingTest
T*True00001
F*False00010
HIHigh0010C
LSLow or Same0011C + Z
CC(HS)Carry Clear0100C
CS(LO)Carry Set0101C
NENot Equal0110Z
EQEqual0111Z
VCOverflow Clear1000V
VSOverflow Set1001V
PLPlus1010N
MIMinus1011N
GE Greater or Equal 1100 N •V + N
LT Less Than 1101 N •V + N •V
GT Greater Than 1110 N •V •Z
LE Less or Equal 1111 Z + N •V + N • V
• = Boolean AND
+ = Boolean OR
N
= Boolean NOT N
*Not available for the Bcc instruction.
•Z
•V
+ N • V •Z
MOTOROLAMC68030 USER’S MANUAL3-17
Instruction Set Summary
3.4 INSTRUCTION SET SUMMARY
Table 3–14 provides a alphabetized listing of the MC68030 instruction set listed by opcode,
operation, and syntax.
Table 3–14 use notational conventions for the operands, the subfields and qualifiers, and
the operations performed by the instructions. In the syntax descriptions, the left operand is
the source operand, and the right operand is the destination operand. The following list
contains the notations used in Table 3–14.
Notation for operands:
PC—Program counter
SR—Status register
V—Overflow condition code
Immediate Data—Immediate data from the instruction
Source—Source contents
Destination—Destination contents
Vector—Location of exception vector
+ inf—Positive infinity
–inf—Negative infinity
〈fmt〉—Operand data format: byte (B) word (W), long
(L), single (S), double (D), extended (X), or
packed (P)
FPm—One of eight floating-point data registers (always
specifies the source register)
FPn—One of eight floating-point data registers (always
specifies the destination register)
Notation for subfields and qualifiers:
〈bit〉 of (operand〉
—Selects a single bit of the operand
〈ea〉 {offset:width}—Selects a bit field
(〈operand〉)—The contents of the referenced location
〈operand〉
—The operand is binary-coded decimal; operations are per-
10
formed in decimal
(〈address register〉)—The register indirect operation
–(〈address register〉)—Indicates that the operand register points to the memory
(〈address register〉) +—Location of the instruction operand — the optional mode
qualifiers are -, +, (d), and (d,ix)
#xxx or #〈data〉—Immediate data that follows the instruction word(s)
3-18MC68030 USER’S MANUALMOTOROLA
Instruction Set Summary
Notations for operations that have two operands, written 〈operand〉 〈op〉 〈operand〉, where
〈op〉 is one of the following:
→—The source operand is moved to the destination operand
↔—The two operands are exchanged
+—The operands are added
–—The destination operand is subtracted from the source
operand
x—The operands are multiplied
÷—The source operand is divided by the destination operand
<—Relational test, true if source operand is less than destina-
tion operand
>—Relational test, true if source operand is greater than des-
tination operand
V—Logical OR
⊕—Logical exclusive OR
Λ—Logical AND
shifted by, rotated by—The source operand is shifted or rotated by the number of
positions specified by the second operand
Notation for single-operand operations:
—The operand is logically complemented
〈operand〉
~〈operand〉
sign-extended—The operand is sign extended; all bits of the upper portion
are made equal to the high-order bit of the lower portion
〈operand〉
tested—The operand is compared to zero and the condition codes
are set appropriately
Notation for other operations:
TRAP—Equivalent to Format/Offset Word
→ SSP; PC→ (SSP); SSP – 4 → SSP; SR→ (SSP);
SSP–2
→ SSP; (vector) → PC
→ (SSP); SSP –2
STOP—Enter the stopped state, waiting for the interrupts
If 〈condition〉 then—The condition is tested. If true, the operations
〈operations〉 else —after "then'' are performed. If the condition is
〈operations〉—false and the optional "else'' clause is present, the opera-
tions after "else" are performed. If the condition is false and
else is omitted, the instruction performs no operation. Refer
to the Bcc instruction description as an example.
MOTOROLAMC68030 USER’S MANUAL3-19
Instruction Set Summary
Table 3-14. Instruction Set Summary (Sheet 1 of 5)