MOTOROLA M68000 FAMILY Programmer's Reference Manual (Includes CPU32 Instructions) MOTOROLA INC., 1992 TABLE OF CONTENTS Paragraph Number Title Page Number Section 1 Introduction 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.2 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.3.3 1.2.3.4 1.2.4 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.4 1.5 1.5.1 1.5.2 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.7 1.7.1 MOTOROLA Integer Unit User Programming Model. . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Data Registers (D7 - D0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Address Registers (A7 - A0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Program Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Condition Code Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Floating-Point Unit User Programming Model . . . . . . . . . . . . . . . . . . . . 1-4 Floating-Point Data Registers (FP7 - FP0) . . . . . . . . . . . . . . . . . . . . . 1-4 Floating-Point Control Register (FPCR) . . . . . . . . . . . . . . . . . . . . . . . 1-5 Exception Enable Byte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Mode Control Byte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Floating-Point Status Register (FPSR) . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Floating-Point Condition Code Byte. . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Quotient Byte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 Exception Status Byte.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 Accrued Exception Byte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 Floating-Point Instruction Address Register (FPIAR) . . . . . . . . . . . . . 1-8 Supervisor Programming Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Address Register 7 (A7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 Vector Base Register (VBR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11 Alternate Function Code Registers (SFC and DFC) . . . . . . . . . . . . . 1-11 Acu Status Register (MC68EC030 only) . . . . . . . . . . . . . . . . . . . . . . 1-11 Transparent Translation/access Control Registers . . . . . . . . . . . . . . 1-12 Transparent Translation/access Control Register Fields for the M68030. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 Transparent Translation/access Control Register Fields for the M68040. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 Integer Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14 Floating-Point Data Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15 Packed Decimal Real Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15 Binary Floating-Point Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16 Floating-Point Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17 Normalized Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18 Denormalized Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18 Zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19 Infinities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19 Not-A-Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19 Data Format and Type Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20 Organization of Data in Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-25 Organization of Integer Data Formats in Registers . . . . . . . . . . . . . . 1-25 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL iii TABLE OF CONTENTS (Continued) Paragraph Number 1.7.2 1.7.3 Title Page Number Organization of Integer Data Formats in Memory . . . . . . . . . . . . . . . 1-27 Organization of Fpu Data Formats in Registers and Memory . . . . . . 1-30 Section 2 Addressing Capabilities 2.1 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.3 2.4 2.5 2.5.1 2.5.2 2.5.2.1 2.5.2.2 2.5.2.3 2.6 2.6.1 2.6.2 Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 Effective Addressing Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Data Register Direct Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Address Register Direct Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Address Register Indirect Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 Address Register Indirect with Postincrement Mode. . . . . . . . . . . . . . 2-6 Address Register Indirect with Predecrement Mode . . . . . . . . . . . . . . 2-7 Address Register Indirect with Displacement Mode . . . . . . . . . . . . . . 2-8 Address Register Indirect with Index (8-Bit Displacement) Mode . . . . 2-9 Address Register Indirect with Index (Base Displacement) Mode. . . 2-10 Memory Indirect Postindexed Mode . . . . . . . . . . . . . . . . . . . . . . . . . 2-11 Memory Indirect Preindexed Mode . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12 Program Counter Indirect with Displacement Mode . . . . . . . . . . . . . 2-13 Program Counter Indirect with Index (8-Bit Displacement) Mode . . . 2-14 Program Counter Indirect with Index (Base Displacement) Mode. . . 2-15 Program Counter Memory Indirect Postindexed Mode . . . . . . . . . . . 2-16 Program Counter Memory Indirect Preindexed Mode . . . . . . . . . . . . 2-17 Absolute Short Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18 Absolute Long Addressing Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18 Immediate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19 Effective Addressing Mode Summary . . . . . . . . . . . . . . . . . . . . . . . . . 2-19 Brief Extension Word Format Compatibility . . . . . . . . . . . . . . . . . . . . . 2-21 Full Extension Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22 No Memory Indirect Action Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24 Memory Indirect Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25 Memory Indirect with Preindex. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25 Memory Indirect with Postindex. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26 Memory Indirect with Index Suppressed.. . . . . . . . . . . . . . . . . . . . 2-27 Other Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28 System Stack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-28 Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-29 Section 3 Instruction Set Summary 3.1 3.1.1 3.1.2 iv Instruction Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Data Movement Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Integer Arithmetic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA TABLE OF CONTENTS (Continued) Paragraph Number 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.1.10 3.1.11 3.1.12 3.1.13 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.4 3.5 3.5.1 3.5.2 3.6 3.6.1 3.6.2 3.7 Title Page Number Logical Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Shift and Rotate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Bit Manipulation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Bit Field Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Binary-Coded Decimal Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Program Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 System Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 Cache Control Instructions (MC68040) . . . . . . . . . . . . . . . . . . . . . . . 3-14 Multiprocessor Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 Memory Management Unit (MMU) Instructions. . . . . . . . . . . . . . . . . 3-15 Floating-Point Arithmetic Instructions . . . . . . . . . . . . . . . . . . . . . . . . 3-15 Integer Unit Condition Code Computation . . . . . . . . . . . . . . . . . . . . . . 3-17 Instruction Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Using the Cas and Cas2 Instructions . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Using the Moves Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Nested Subroutine Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Bit Field Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 Pipeline Synchronization with the Nop Instruction. . . . . . . . . . . . . . . 3-21 Floating-Point Instruction Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21 Floating-Point Computational Accuracy . . . . . . . . . . . . . . . . . . . . . . . . 3-23 Intermediate Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24 Rounding the Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25 Floating-Point Postprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27 Underflow, Round, Overflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28 Conditional Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28 Instruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32 Section 4 Integer Instructions Section 5 Floating Point Instructions Section 6 Supervisor (Privileged) Instructions Section 7 CPU32 Instructions Section 8 Instruction Format Summary 8.1 MOTOROLA Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL v TABLE OF CONTENTS (Continued) Paragraph Number 8.1.1 8.1.2 8.1.3 8.1.4 8.1.5 8.1.6 8.1.7 8.1.7.1 8.1.7.2 8.1.8 8.1.9 8.1.10 8.2 Title Page Number Coprocessor ID Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Effective Address Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Register/Memory Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Source Specifier Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Destination Register Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conditional Predicate Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shift and Rotate Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Count Register Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Register Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Size Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Opmode Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Address/Data Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operation Code Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 8-1 8-1 8-1 8-2 8-2 8-2 8-2 8-2 8-4 8-4 8-4 8-4 Appendix A Processor Instruction Summary A.1 A.1.1 A.1.2 A.2 A.2.1 A.2.2 A.3 A.3.1 A.3.2 A.4 A.4.1 A.4.2 A.5 A.5.1 A.5.2 A.6 A.6.1 A.6.2 MC68000, MC68008, MC68010 Processors . . . . . . . . . . . . . . . . . . . . M68000, MC68008, and MC68010 Instruction Set . . . . . . . . . . . . . . MC68000, MC68008, and MC68010 Addressing Modes . . . . . . . . . MC68020 Processors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68020 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68020 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68030 Processors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68030 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68030 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68040 Processors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68040 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68040 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68881/MC68882 Coprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68881/MC68882 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . MC68881/MC68882 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . MC68851 Coprocessors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68851 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC68851 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-12 A-12 A-16 A-17 A-17 A-20 A-21 A-21 A-24 A-25 A-25 A-29 A-30 A-30 A-31 A-31 A-31 A-31 Appendix B Exception Processing Reference B.1 B.2 B.3 vi Exception Vector Assignments for the M68000 Family . . . . . . . . . . . . . B-1 Exception Stack Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3 Floating-Point Stack Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-10 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA TABLE OF CONTENTS (Concluded) Paragraph Number Title Page Number Appendix C S-Record Output Format C.1 C.2 C.3 MOTOROLA S-Record Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-1 S-Record Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-2 S-Record Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL vii LIST OF FIGURES Figure Number Title 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9 1-11 1-12 1-13 1-14 1-15 1-16 1-17 1-19 1-18 1-20 1-21 1-22 M68000 Family User Programming Model....................................................... 1-2 M68000 Family Floating-Point Unit User Programming Model ........................ 1-4 Floating-Point Control Register ........................................................................ 1-5 FPSR Condition Code Byte.............................................................................. 1-6 FPSR Quotient Code Byte ............................................................................... 1-6 FPSR Exception Status Byte ........................................................................... 1-6 FPSR Accrued Exception Byte ........................................................................ 1-7 Status Register............................................................................................... 1-11 MC68030 Transparent Translation/MC68EC030 Access Control Register Format................................................................................. 1-12 MC68040 and MC68LC040 Transparent Translation/MC68EC040 Access Control Register Format .................................................................... 1-13 Packed Decimal Real Format ........................................................................ 1-16 Binary Floating-Point Data Formats ............................................................... 1-16 Normalized Number Format........................................................................... 1-18 Denormalized Number Format....................................................................... 1-18 Zero Format ................................................................................................... 1-19 Infinity Format ................................................................................................ 1-19 Not-A-Number Format.................................................................................... 1-19 Organization of Integer Data Formats in Address Registers.......................... 1-26 Organization of Integer Data Formats in Data Registers ............................... 1-26 Memory Operand Addressing ........................................................................ 1-27 Memory Organization for Integer Operands................................................... 1-29 Organization of FPU Data Formats in Memory .............................................. 1-30 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 Instruction Word General Format..................................................................... 2-1 Instruction Word Specification Formats ........................................................... 2-2 M68000 Family Brief Extension Word Formats.............................................. 2-21 Addressing Array Items.................................................................................. 2-23 No Memory Indirect Action............................................................................. 2-24 Memory Indirect with Preindex....................................................................... 2-26 Memory Indirect with Postindex .................................................................... 2-27 Memory Indirect with Index Suppress ........................................................... 2-27 3-1 3-2 3-3 Intermediate Result Format............................................................................ 3-24 Rounding Algorithm Flowchart ....................................................................... 3-26 Instruction Description Format ....................................................................... 3-33 B-1 B-2 B-3 B-4 MC68000 Group 1 and 2 Exception Stack Frame ...........................................B-3 MC68000 Bus or Address Error Exception Stack Frame.................................B-3 Four-Word Stack Frame, Format $0 ................................................................B-3 Throwaway Four-Word Stack Frame, Format $1.............................................B-3 1-10 MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL Page Number ix LIST OF FIGURES (Concluded) Figure Number Title B-5 B-6 B-7 B-11 B-12 B-13 B-14 B-15 B-16 B-17 B-18 B-19 B-20 B-21 B-22 B-23 Six-Word Stack Frame, Format $2...................................................................B-4 MC68040 Floating-Point Post-Instruction Stack Frame, Format $3.................B-4 MC68EC040 and MC68LC040 Floating-Point Unimplemented Stack Frame, Format $4 ..................................................................................B-5 MC68040 Access Error Stack Frame, Format $7 ...........................................B-5 MC68010 Bus and Address Error Stack Frame, Format $8 ...........................B-6 MC68020 Bus and MC68030 Coprocessor Mid-Instruction Stack Frame, Format $9 ..................................................................................B-6 MC68020 and MC68030 Short Bus Cycle Stack Frame, Format $A ...............B-7 MC68020 and MC68030 Long Bus Cycle Stack Frame, Format $B...............B-8 CPU32 Bus Error for Prefetches and Operands Stack Frame, Format $C.....B-8 CPU32 Bus Error on MOVEM Operand Stack Frame, Format $C .................B-9 CPU32 Four- and Six-Word Bus Error Stack Frame, Format $C....................B-9 MC68881/MC68882 and MC68040 Null Stack Frame..................................B-10 MC68881 Idle Stack Frame ..........................................................................B-10 MC68881 Busy Stack Frame ........................................................................B-11 MC68882 Idle Stack Frame ...........................................................................B-11 MC68882 Busy Stack Frame .........................................................................B-11 MC68040 Idle Busy Stack Frame ..................................................................B-12 MC68040 Unimplimented Instruction Stack Frame........................................B-12 MC68040 Busy Stack Frame .........................................................................B-13 C-1 C-2 Five Fields of an S-Record...............................................................................C-1 Transmission of an S1 Record.........................................................................C-4 B-8 B-9 B-10 x M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL Page Number MOTOROLA LIST OF TABLES Table Number Title Page Number 1-1 1-2 1-3 1-4 1-5 1-6 1-6 1-7 1-8 Supervisor Registers Not Related To Paged Memory Management .............. 1-9 Supervisor Registers Related To Paged Memory Management................... 1-10 Integer Data Formats .................................................................................... 1-15 Single-Precision Real Format Summary Data Format .................................. 1-21 Double-Precision Real Format Summary...................................................... 1-22 Extended-Precision Real Format Summary.................................................. 1-23 Extended-Precision Real Format Summary (Continued) .............................. 1-24 Packed Decimal Real Format Summary ....................................................... 1-24 MC68040 FPU Data Formats and Data Types ............................................. 1-30 2-1 2-2 2-3 2-4 Instruction Word Format Field Definitions ....................................................... 2-3 IS-I/IS Memory Indirect Action Encodings....................................................... 2-4 Immediate Operand Location........................................................................ 2-19 Effective Addressing Modes and Categories ................................................ 2-20 3-1 3-1 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 3-12 3-13 3-14 3-15 3-16 3-17 3-18 3-19 3-20 3-21 3-22 3-23 5-1 5-2 Notational Conventions ................................................................................... 3-2 Notational Conventions (Continued) ............................................................... 3-3 Notational Conventions (Concluded) .............................................................. 3-4 Data Movement Operation Format.................................................................. 3-6 Integer Arithmetic Operation Format............................................................... 3-7 Logical Operation Format................................................................................ 3-8 Shift and Rotate Operation Format ................................................................. 3-9 Bit Manipulation Operation Format ............................................................... 3-10 Bit Field Operation Format ............................................................................ 3-10 Binary-Coded Decimal Operation Format ..................................................... 3-11 Program Control Operation Format............................................................... 3-12 System Control Operation Format ................................................................ 3-13 Cache Control Operation Format .................................................................. 3-14 Multiprocessor Operations ............................................................................ 3-14 MMU Operation Format ................................................................................ 3-15 Dyadic Floating-Point Operation Format....................................................... 3-16 Dyadic Floating-Point Operations ................................................................. 3-16 Monadic Floating-Point Operation Format .................................................... 3-16 Monadic Floating-Point Operations............................................................... 3-17 Integer Unit Condition Code Computations................................................... 3-18 Conditional Tests .......................................................................................... 3-19 Operation Table Example (FADD Instruction)............................................... 3-22 FPCR Encodings........................................................................................... 3-25 FPCC Encodings........................................................................................... 3-29 Floating-Point Conditional Tests ................................................................... 3-31 Directly Supported Floating-Point Instructions ................................................ 5-2 Indirectly Supported Floating-Point Instructions.............................................. 5-3 MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL xi LIST OF TABLES (Continued) Table Number Title Page Number 7-1 7-2 7-3 MC68020 Instructions Not Supported ............................................................. 7-1 M68000 Family Addressing Modes................................................................. 7-2 CPU32 Instruction Set..................................................................................... 7-3 8-1 8-2 Conditional Predicate Field Encoding ............................................................. 8-3 Operation Code Map....................................................................................... 8-4 A-1 A-2 A-3 A-4 A-5 A-6 A-7 A-8 A-9 A-10 A-11 A-12 A-13 M68000 Family Instruction Set And Processor Cross-Reference................... A-1 M68000 Family Instruction Set........................................................................ A-8 MC68000 and MC68008 Instruction Set ....................................................... A-12 MC68010 Instruction Set............................................................................... A-14 MC68000, MC68008, and MC68010 Data Addressing Modes ..................... A-16 MC68020 Instruction Set Summary .............................................................. A-17 MC68020 Data Addressing Modes ............................................................... A-20 MC68030 Instruction Set Summary .............................................................. A-21 MC68030 Data Addressing Modes ............................................................... A-24 MC68040 Instruction Set............................................................................... A-25 MC68040 Data Addressing Modes ............................................................... A-29 MC68881/MC68882 Instruction Set .............................................................. A-30 MC68851 Instruction Set............................................................................... A-31 B-1 Exception Vector Assignments for the M68000 Family................................... B-2 C-1 C-2 Field Composition of an S-Record ..................................................................C-1 ASCII Code .....................................................................................................C-5 xii M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA SECTION 1 INTRODUCTION This manual contains detailed information about software instructions used by the microprocessors and coprocessors in the M68000 family, including: MC68000 MC68EC000 MC68HC000 MC68008 MC68010 MC68020 MC68EC020 MC68030 MC68EC030 MC68040 MC68LC040 MC68EC040 MC68330 MC68340 MC68851 MC68881 MC68882 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 16-/32-Bit Microprocessor 16-/32-Bit Embedded Controller Low Power 16-/32-Bit Microprocessor 16-Bit Microprocessor with 8-Bit Data Bus 16-/32-Bit Virtual Memory Microprocessor 32-Bit Virtual Memory Microprocessor 32-Bit Embedded Controller Second-Generation 32-Bit Enhanced Microprocessor 32-Bit Embedded Controller Third-Generation 32-Bit Microprocessor Third-Generation 32-Bit Microprocessor 32-Bit Embedded Controller Integrated CPU32 Processor Integrated Processor with DMA Paged Memory Management Unit Floating-Point Coprocessor Enhanced Floating-Point Coprocessor NOTE All references to the MC68000, MC68020, and MC68030 include the corresponding embedded controllers, MC68EC000, MC68EC020, and MC68EC030. All references to the MC68040 include the MC68LC040 and MC68EC040. This referencing method applies throughout the manual unless otherwise specified. The M68000 family programming model consists of two register groups: user and supervisor. User programs executing in the user mode only use the registers in the user group. System software executing in the supervisor mode can access all registers and uses the control registers in the supervisor group to perform supervisor functions. The following paragraphs provide a brief description of the registers in the user and supervisor models as well as the data organization in the registers. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-1 Introduction 1.1 INTEGER UNIT USER PROGRAMMING MODEL Figure 1-1 illustrates the integer portion of the user programming model. It consists of the following registers: * 16 General-Purpose 32-Bit Registers (D7 - D0, A7 - A0) * 32-Bit Program Counter (PC) * 8-Bit Condition Code Register (CCR) . 31 31 31 15 0 15 D0 D1 D2 D3 D4 D5 D6 D7 DATA REGISTERS A0 A1 A2 A3 A4 A5 A6 ADDRESS REGISTERS 0 15 0 31 A7 (USP) 0 PC 15 7 0 CCR USER STACK POINTER PROGRAM COUNTER CONDITION CODE REGISTER Figure 1-1. M68000 Family User Programming Model 1.1.1 Data Registers (D7 - D0) These registers are for bit and bit field (1 - 32 bits), byte (8 bits), word (16 bits), long-word (32 bits), and quad-word (64 bits) operations. They also can be used as index registers. 1.1.2 Address Registers (A7 - A0) These registers can be used as software stack pointers, index registers, or base address registers. The base address registers can be used for word and long-word operations. Register A7 is used as a hardware stack pointer during stacking for subroutine calls and exception handling. In the user programming model, A7 refers to the user stack pointer (USP). 1-2 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction 1.1.3 Program Counter The PC contains the address of the instruction currently executing. During instruction execution and exception processing, the processor automatically increments the contents or places a new value in the PC. For some addressing modes, the PC can be used as a pointer for PC relative addressing. 1.1.4 Condition Code Register Consisting of five bits, the CCR, the status register's lower byte, is the only portion of the status register (SR) available in the user mode. Many integer instructions affect the CCR, indicating the instruction's result. Program and system control instructions also use certain combinations of these bits to control program and system flow. The condition codes meet two criteria: consistency across instructions, uses, and instances and meaningful results with 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 uses means that conditional instructions test the condition codes similarly and provide the same results whether a compare, test, or move instruction sets the condition codes. Consistency across instances means that all instances of an instruction affect the condition codes in the same way. The first four bits represent a condition of the result generated by an operation. The fifth bit or the extend bit (X-bit) is an operand for multiprecision computations. The carry bit (C-bit) and the X-bit are separate in the M68000 family to simplify programming techniques that use them (refer to Table 3-18 as an example). In the instruction set definitions, the CCR is illustrated as follows: X N Z V C 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; otherwise clear. Z--Zero Set if the result equals zero; otherwise clear. V--Overflow Set if an arithmetic overflow occurs implying that the result cannot be represented in the operand size; otherwise clear. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-3 Introduction C--Carry Set if a carry out of the most significant bit of the operand occurs for an addition, or if a borrow occurs in a subtraction; otherwise clear. 1.2 FLOATING-POINT UNIT USER PROGRAMMING MODEL The following paragraphs describe the registers for the floating- point unit user programming model. Figure 1-2 illustrates the M68000 family user programming model's floating-point portion for the MC68040 and the MC68881/MC68882 floating-point coprocessors. It contains the following registers: * 8 Floating-Point Data Registers (FP7 - FP0) * 16-Bit Floating-Point Control Register (FPCR) * 32-Bit Floating-Point Status Register (FPSR) * 32-Bit Floating-Point Instruction Address Register (FPIAR) 79 63 0 FP0 FP1 FP2 FP3 FP4 FLOATING-POINT DATA REGISTERS FP5 FP6 FP7 31 15 31 23 CONDITION CODE 7 EXCEPTION ENABLE 0 15 QUOTIENT 0 MODE CONTROL 7 EXCEPTION STATUS FPCR FLOATING-POINT CONTROL REGISTER FPSR FLOATING-POINT STATUS REGISTER FPIAR FLOATING-POINT INSTRUCTION ADDRESS REGISTER 0 ACCRUED EXCEPTION Figure 1-2. M68000 Family Floating-Point Unit User Programming Model 1.2.1 Floating-Point Data Registers (FP7 - FP0) These floating-point data registers are analogous to the integer data registers for the M68000 family. They always contain extended- precision numbers. All external operands, despite the data format, are converted to extended-precision values before being used in any calculation or being stored in a floating-point data register. A reset or a null-restore operation sets FP7 - FP0 positive, nonsignaling not-a-numbers (NANs). 1-4 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction 1.2.2 Floating-Point Control Register (FPCR) The FPCR (see Figure 1-3) contains an exception enable (ENABLE) byte and a mode control (MODE) byte. The user can read or write to the FPCR. Motorola reserves bits 31 - 16 for future definition; these bits are always read as zero and are ignored during write operations. The reset function or a restore operation of the null state clears the FPCR. When cleared, this register provides the IEEE 754 Standard for Binary Floating-Point Arithmetic defaults. 1.2.2.1 EXCEPTION ENABLE BYTE. Each bit of the ENABLE byte (see Figure 1-3) corresponds to a floating-point exception class. The user can separately enable traps for each class of floating-point exceptions. 1.2.2.2 MODE CONTROL BYTE. MODE (see Figure 1-3) controls the user- selectable rounding modes and precisions. Zeros in this byte select the IEEE 754 standard defaults. The rounding mode (RND) field specifies how inexact results are rounded, and the rounding precision (PREC) field selects the boundary for rounding the mantissa. Refer to Table 3-21 for encoding information. . MODE CONTROL EXCEPTION ENABLE 15 BSUN 14 13 SNAN OPERR 12 11 10 9 8 OVFL UNFL DZ INEX2 INEX1 7 6 PREC 5 4 3 RND 2 1 0 0 ROUNDING MODE ROUNDING PRECISION INEXACT DECIMAL INPUT INEXACT OPERATION DIVIDE BY ZERO UNDERFLOW OVERFLOW OPERAND ERROR SIGNALING NOT-A-NUMBER BRANCH/SET ON UNORDERED Figure 1-3. Floating-Point Control Register 1.2.3 Floating-Point Status Register (FPSR) The FPSR (see Figure 1-2) contains a floating-point condition code (FPCC) byte, a floatingpoint exception status (EXC) byte, a quotient byte, and a floating-point accrued exception (AEXC) byte. The user can read or write to all the bits in the FPSR. Execution of most floating-point instructions modifies this register. The reset function or a restore operation of the null state clears the FPSR. 1.2.3.1 FLOATING-POINT CONDITION CODE BYTE. The FPCC byte, illustrated in Figure 1-4, contains four condition code bits that set after completion of all arithmetic instructions involving the floating-point data registers. The move floating-point data register MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-5 Introduction to effective address, move multiple floating-point data register, and move system control register instructions do not affect the FPCC. . 31 28 27 26 25 24 N Z I NAN 0 NOT-A-NUMBER OR UNORDERED INFINITY ZERO NEGATIVE Figure 1-4. FPSR Condition Code Byte 1.2.3.2 QUOTIENT BYTE. The quotient byte contains the seven least significant bits of the unsigned quotient as well as the sign of the entire quotient (see Figure 1-5). The quotient bits can be used in argument reduction for transcendentals and other functions. For example, seven bits are more than enough to figure out the quadrant of a circle in which an operand resides. The quotient bits remain set until the user clears them. . 23 22 16 S QUOTIENT SEVEN LEAST SIGNIFICANT BITS OF QUOTIENT SIGN OF QUOTIENT Figure 1-5. FPSR Quotient Code Byte 1.2.3.3 EXCEPTION STATUS BYTE. The EXC byte, illustrated in Figure 1- 6, contains a bit for each floating-point exception that might have occurred during the most recent arithmetic instruction or move operation. This byte is cleared at the start of all operations that generate floating-point exceptions. Operations that do not generate floating-point exceptions do not clear this byte. An exception handler can use this byte to determine which floating-point exception(s) caused a trap. . 15 14 13 12 11 10 9 8 BSUN SNAN OPERR OVFL UNFL DZ INEX2 INEX1 BRANCH/SET ON UNORDERED INEXACT DECIMAL INPUT SIGNALING NOT-A-NUMBER INEXACT OPERATION DIVIDE BY ZERO OPERAND ERROR UNDERFLOW OVERFLOW Figure 1-6. FPSR Exception Status Byte 1-6 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction 1.2.3.4 ACCRUED EXCEPTION BYTE. The AEXC byte contains five exception bits (see Figure 1-7) required by the IEEE 754 standard for trap disabled operations. These exceptions are logical combinations of the bits in the EXC byte. The AEXC byte contains a history of all floating-point exceptions that have occurred since the user last cleared the AEXC byte. In normal operations, only the user clears this byte by writing to the FPSR; however, a reset or a restore operation of the null state can also clear the AEXC byte. Many users elect to disable traps for all or part of the floating- point exception classes. The AEXC byte makes it unnecessary to poll the EXC byte after each floating-point instruction. At the end of most operations (FMOVEM and FMOVE excluded), the bits in the EXC byte are logically combined to form an AEXC value that is logically ORed into the existing AEXC byte. This operation creates "sticky" floating- point exception bits in the AEXC byte that the user needs to poll only once--i.e., at the end of a series of floating-point operations. . 7 6 5 4 3 IOP OVFL UNFL DZ INEX 2 1 0 INEXACT DIVIDE BY ZERO UNDERFLOW OVERFLOW INVALID OPERATION Figure 1-7. FPSR Accrued Exception Byte Setting or clearing the AEXC bits neither causes nor prevents an exception. The following equations show the comparative relationship between the EXC byte and AEXC byte. Comparing the current value in the AEXC bit with a combination of bits in the EXC byte derives a new value in the corresponding AEXC bit. These equations apply to setting the AEXC bits at the end of each operation affecting the AEXC byte: New AEXC Bit = Old AEXC Bit V EXC Bits = IOP V (SNAN V OPERR) OVFL = OVFL V (OVFL) UNFL = UNFL V (UNFL L INEX2) = DZ V (DZ) = INEX V (INEX1 V INEX2 V OVFL) IOP DZ INEX MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-7 Introduction 1.2.4 Floating-Point Instruction Address Register (FPIAR) The integer unit can be executing instructions while the FPU is simultaneously executing a floating-point instruction. Additionally, the FPU can concurrently execute two floating-point instructions. Because of this nonsequential instruction execution, the PC value stacked by the FPU, in response to a floating-point exception trap, may not point to the offending instruction. For the subset of the FPU instructions that generate exception traps, the 32-bit FPIAR is loaded with the logical address of the instruction before the processor executes it. The floating-point exception handler can use this address to locate the floating-point instruction that caused an exception. Since the FPU FMOVE to/from the FPCR, FPSR, or FPIAR and FMOVEM instructions cannot generate floating- point exceptions, these instructions do not modify the FPIAR. A reset or a null-restore operation clears the FPIAR. 1.3 SUPERVISOR PROGRAMMING MODEL System programers use the supervisor programming model to implement sensitive operating system functions--e.g., I/O control and memory management unit (MMU) subsystems. The following paragraphs briefly describe the registers in the supervisor programming model. They can only be accessed via privileged instructions. Table 1-1 lists the supervisor registers and the processors not related to paged memory management. For information concerning page memory management programming, refer to the devicespecific user's manual. Table 1-2 lists the supervisor registers and the processors related to paged memory management. 1-8 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction Table 1-1. Supervisor Registers Not Related To Paged Memory Management Devices 68000 68008 68HC000 68HC001 Registers 68EC000 68010 68020 68EC020 CPU32 68030 AC1, AC0 68EC030 68040 68EC040 68LC040 x x x x ACUSR x CAAR x x x CACR x x x DACR1, DACR0 x DFC x x x x x DTT1, DTT0 x x x IACR1, IACR0 x x x ITT1, ITT0 x MSP x SFC x x x x x x x x x x x x x x SR x x x x x x x x x SSP/ISP x x x x x x x x x x x x x TT1, TT0 x VBR AC1, AC0 ACUSR CAAR CACR DACR1, DACR0 DFC DTT1, DTT0 IACR1, IACR0 MOTOROLA x = = = = = = = = x x Access Control Registers Access Control Unit Status Register Cache Address Register Cache Control Register Data Access ControlRegisters Destination Function Code Register Data Transparent Translation Registers Instruction Access Control Registers x ITT1, ITT0 = Instruction Transparent Translation Registers MSP = Master Stack Pointer Register SFC = Source Function Code Register SR = Status Register SSP/ISP = Supervisor and Interrupt Stack Pointer TT1, TT0 = Transparent Translation Registers VBR = Vector Base Register M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-9 Introduction Table 1-2. Supervisor Registers Related To Paged Memory Management Devices Registers 68851 68030 68040 68LC040 x x x x x AC x CAL x CRP x DRP x PCSR x PMMUSR, MMUSR x SCC x SRP x x TC x x URP VAL AC CAL CRP DRP PCSR PMMUSR MMUSR SCC SRP TC URP VAL x x x x x x = = = = = = = = = = = = Access Control Register Current Access Level Register CPU Root Pointer DMA Root Pointer PMMU Control Register Paged Memory Management Unit Status Register Memory Management Unit Status Register Stack Change Control Register Supervisor Root Pointer Register Translation Control Register User Root Pointer Valid Access Level Register 1.3.1 Address Register 7 (A7) In the supervisor programming model register, A7 refers to the interrupt stack pointer, A7'(ISP) and the master stack pointer, A7" (MSP). The supervisor stack pointer is the active stack pointer (ISP or MSP). For processors that do not support ISP or MSP, the system stack is the system stack pointer (SSP). The ISP and MSP are general- purpose address registers for the supervisor mode. They can be used as software stack pointers, index registers, or base address registers. The ISP and MSP can be used for word and long-word operations. 1.3.2 Status Register Figure 1-8 illustrates the SR, which stores the processor status and contains the condition codes that reflect the results of a previous operation. In the supervisor mode, software can access the full SR, including the interrupt priority mask and additional control bits. These bits indicate the following states for the processor: one of two trace modes (T1, T0), supervisor or user mode (S), and master or interrupt mode (M). For the MC68000, MC68EC000, MC68008, MC68010, MC68HC000, MC68HC001, and CPU32, only one trace mode 1-10 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction supported, where T0 is always zero, and only one system stack where the M-bit is always zero. I2, I1, and I0 define the interrupt mask level. . USER BYTE (CONDITION CODE REGISTER) SYSTEM BYTE 15 14 13 12 11 10 9 8 T1 T0 S M 0 I2 I1 I0 TRACE ENABLE 7 65 0 0 4 0 X 3 N 2 Z 1 V INTERRUPT PRIORITY MASK 0 C CARRY OVERFLOW SUPERVISOR/USER STATE ZERO NEGATIVE MASTER/INTERRUPT STATE EXTEND T1 T0 TRACE MODE S M ACTIVE STACK 0 0 NO TRACE 0 x USP 1 0 TRACE ON ANY INSTRUCTION 1 0 ISP 0 1 TRACE ON CHANGE OF FLOW 1 1 MSP 1 1 UNDEFINED Figure 1-8. Status Register 1.3.3 Vector Base Register (VBR) The VBR contains the base address of the exception vector table in memory. The displacement of an exception vector adds to the value in this register, which accesses the vector table. 1.3.4 Alternate Function Code Registers (SFC and DFC) The alternate function code registers contain 3-bit function codes. Function codes can be considered extensions of the 32-bit logical address that optionally provides as many as eight 4-Gbyte address spaces. The processor automatically generates function codes to select address spaces for data and programs at the user and supervisor modes. Certain instructions use SFC and DFC to specify the function codes for operations. 1.3.5 Acu Status Register (MC68EC030 only) The access control unit status register (ACUSR) is a 16-bit register containing the status information returned by execution of the PTEST instruction. The PTEST instruction searches the access control (AC) registers to determine a match for a specified address. A match in either or both of the AC registers sets bit 6 in the ACUSR. All other bits in the ACUSR are undefined and must not be used. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-11 Introduction 1.3.6 Transparent Translation/access Control Registers Transparent translation is actually a misnomer since the whole address space transparently translates in an embedded control environment with no on-chip MMU present as well as in processors that have built-in MMUs. For processors that have built-in MMUs, such as the MC68030, MC68040, and MC68LC040, the transparent translation (TT) registers define blocks of logical addresses that are transparently translated to corresponding physical addresses. These registers are independent of the on-chip MMU. For embedded controllers, such as the MC68EC030 and MC68EC040, the access control registers (AC) are similar in function to the TT registers but just named differently. The AC registers, main function are to define blocks of address space that control address space properties such as cachability. The following paragraphs describe these registers. NOTE For the paged MMU related supervisor registers, please refer to the appropriate user's manual for specific programming detail. 1.3.6.1 TRANSPARENT TRANSLATION/ACCESS CONTROL REGISTER FIELDS FOR THE M68030. Figure 1-9 illustrates the MC68030 transparent translation/MC68EC030 access control register format. 31 E 15 24 0 14 0 13 ADDRESS BASE 0 0 12 11 CI 10 R/W 9 RWM 8 23 0 7 16 6 ADDRESS MASK FC BASE 0 4 3 FC MASK 2 0 Figure 1-9. MC68030 Transparent Translation/MC68EC030 Access Control Register Format Address Base This 8-bit field is compared with address bits A31 - A24. Addresses that match in this comparison (and are otherwise eligible) are transparently translated/access controlled. Address Mask This 8-bit field contains a mask for the address base field. Setting a bit in this field causes the corresponding bit of the address base field to be ignored. Blocks of memory larger than 16 Mbytes can be transparently translated/accessed controlled by setting some logical address mask bits to ones. The low-order bits of this field normally are set to define contiguous blocks larger than 16 Mbytes, although this is not required. 1-12 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction E--Enable 0 = Transparent translation/access control disabled 1 = Transparent translation/access control enabled CI--Cache Inhibit 0 = Caching allowed 1 = Caching inhibited R/W--Read/Write 0 = Only write accesses permitted 1 = Only read accesses permitted R/WM--Read/Write Mask 0 = R/W field used 1 = R/W field ignored FC BASE--Function Code Base This 3-bit field defines the base function code for accesses to be transparently translated with this register. Addresses with function codes that match the FC BASE field (and are otherwise eligible) are transparently translated. FC MASK--Function Code Mask This 3-bit field contains a mask for the FC BASE field. Setting a bit in this field causes the corresponding bit of the FC BASE field to be ignored. 1.3.6.2 TRANSPARENT TRANSLATION/ACCESS CONTROL REGISTER FIELDS FOR THE M68040. Figure 1-10 illustrates the MC68040 and MC68LC040 transparent translation/ MC68EC040 access control register format. 31 E 15 24 S FIELD 14 13 ADDRESS BASE 0 0 12 11 0 10 U1 9 U0 8 23 0 7 16 CM 6 5 ADDRESS MASK 0 0 4 3 W 2 0 1 0 0 Figure 1-10. MC68040 and MC68LC040 Transparent Translation/MC68EC040 Access Control Register Format Address Base This 8-bit field is compared with address bits A31 - A24. Addresses that match in this comparison (and are otherwise eligible) are transparently translated/access controlled. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-13 Introduction Address Mask This 8-bit field contains a mask for the address base field. Setting a bit in this field causes the corresponding bit in the address base field to be ignored. Blocks of memory larger than 16 Mbytes can be transparently translated/access controlled by setting some logical address mask bits to ones. The low-order bits of this field normally are set to define contiguous blocks larger than 16 Mbytes, although this not required. E--Enable This bit enables and disables transparent translation/access control of the block defined by this register. 0 = Transparent translation/access control disabled 1 = Transparent translation/access control enabled S--Supervisor/User Mode This field specifies the use of the FC2 in matching an address. 00 = Match only if FC2 is 0 (user mode access) 01 = Match only if FC2 is 1 (supervisor mode access) 1X = Ignore FC2 when matching U1, U2--User Page Attributes The MC68040, MC68E040, MC68LC040 do not interpret these user-defined bits. If an external bus transfer results from the access, U0 and U1 are echoed to the UPA0 and UPA1 signals, respectively. CM--Cache Mode This field selects the cache mode and access serialization for a page as follows: 00 = Cachable, Writethrough 01 = Cachable, Copyback 10 = Noncachable, Serialized 11 = Noncachable W--Write Protect This bit indicates if the block is write protected. If set, write and read-modify-write accesses are aborted as if the resident bit in a table descriptor were clear. 0 = Read and write accesses permitted 1 = Write accesses not permitted 1.4 INTEGER DATA FORMATS The operand data formats supported by the integer unit, as listed in Table 1-3, include those supported by the MC68030 plus a new data format (16-byte block) for the MOVE16 instruction. Integer unit operands can reside in registers, memory, or instructions themselves. The operand size for each instruction is either explicitly encoded in the instruction or implicitly defined by the instruction operation. 1-14 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction Table 1-3. Integer Data Formats Operand Data Format Size Notes Bit 1 Bit -- Bit Field 1 - 32 Bits Field of Consecutive Bit Binary-Coded Decimal (BCD) 8 Bits Byte Integer 8 Bits -- Word Integer 16 Bits -- Long-Word Integer 32 Bits -- Quad-Word Integer 64 Bits Any Two Data Registers 16-Byte 128 Bits Memory Only, Aligned to 16- Byte Boundary Packed: 2 Digits/Byte; Unpacked: 1 Digit/Byte 1.5 FLOATING-POINT DATA FORMATS The following paragraphs describe the FPU's operand data formats. The FPU supports seven data formats. There are three signed binary integer formats (byte, word, and long word) that are identical to those supported by the integer unit. The FPU supports the use of the packed decimal real format. The MC68881 and MC68882 support this format in hardware and the processors starting with the MC68040 support it in software. The FPU also supports three binary floating- point formats (single, double, and extended precision) that fully comply with the IEEE 754 standard. All references in this manual to extendedprecision format imply the double-extended-precision format defined by the IEEE 754 standard. 1.5.1 Packed Decimal Real Format Figure 1-11 illustrates the packed decimal real format which is three long words consisting of a 3-digit base 10 exponent and a 17-digit base 10 mantissa. The first two long words, digits 15 - 0, are 64 bits and map directly to bit positions 63 - 0 of the extended-precision real format. There are two separate sign bits, one for the exponent, the other for the mantissa. An extra exponent (EXP3) is defined for overflows that can occur when converting from the extended-precision real format to the packed decimal real format. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-15 Introduction . SIGN OF MANTISSA SIGN OF EXPONENT USED ONLY FOR INFINITY OR NANS IMPLICIT DECIMAL POINT 96 65 SM SE Y Y EXP 0 EXP 1 EXP 0 (EXP 3) XXXX XXXX DIGIT 16 DIGIT 15 DIGIT 14 DIGIT 13 DIGIT 12 DIGIT 11 DIGIT 10 DIGIT 9 DIGIT 8 DIGIT 7 DIGIT 6 DIGIT 5 DIGIT 4 DIGIT 3 DIGIT 2 DIGIT 1 DIGIT 0 32 0 NOTE: XXXX indicates "don't care", which is zero when written and ignored when read. Figure 1-11. Packed Decimal Real Format 1.5.2 Binary Floating-Point Formats Figure 1-12 illustrates the three binary floating-point data formats. The exponent in the three binary floating-point formats is an unsigned binary integer with an implied bias added to it. When subtracting the bias from the exponent's value, the result represents a signed twos complement power of two. This yields the magnitude of a normalized floating-point number when multiplied by the mantissa. A program can execute a CMP instruction that compares floating-point numbers in memory using biased exponents, despite the absolute magnitude of the exponents. . 30 S 22 8-BIT EXPONENT 0 23-BIT FRACTION SINGLE REAL SIGN OF FRACTION 62 S 51 0 52-BIT FRACTION 11-BIT EXPONENT DOUBLE REAL SIGN OF FRACTION 94 S 80 15-BIT EXPONENT 63 ZERO SIGN OF MANTISSA 0 64-BIT MANTISSA EXTENDED REAL EXPLICIT INTEGER PART BIT Figure 1-12. Binary Floating-Point Data Formats Data formats for single- and double-precision numbers differ slightly from those for extended-precision numbers in the representation of the mantissa. For all three precisions, a normalized mantissa is always in the range (1.0...2.0). The extended-precision data format represents the entire mantissa, including the explicit integer part bit. Single- and doubleprecision data formats represent only a fractional portion of the mantissa (the fraction) and always imply the integer part as one. 1-16 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction The IEEE 754 standard has created the term significand to bridge the difference between mantissa and fraction and to avoid the historical implications of the term mantissa. The IEEE 754 standard defines a significand as the component of a binary floating-point number that includes an explicit or implicit leading bit to the left of the implied binary point. However, this manual uses the term mantissa for extended-precision formats and fraction for single- and double- precision formats instead of the IEEE term significand. NOTE This section specifies ranges using traditional set notation with the format "bound...bound" specifying the boundaries of the range. The bracket types enclosing the range define whether the endpoint is inclusive or exclusive. A square bracket indicates inclusive, and a parenthesis indicates exclusive. For example, the range specification "[1.0...2.0]" defines the range of numbers greater than or equal to 1.0 and less than or equal to 2.0. The range specification "(0.0... + inf)" defines the range of numbers greater than 0.0 and less than positive infinity, but not equal to. 1.6 FLOATING-POINT DATA TYPES Each floating-point data format supports five, unique, floating-point data types: 1) normalized numbers, 2) denormalized numbers, 3) zeros, 4) infinities, and 5) NANs. Exponent values in each format represent these special data types. The normalized data type never uses the maximum or minimum exponent value for a given format, except the extended-precision format. The packed decimal real data format does not support denormalized numbers. There is a subtle difference between the definition of an extended- precision number with an exponent equal to zero and a single- or double-precision number with an exponent equal to zero. The zero exponent of a single- or double-precision number denormalizes the number's definition, and the implied integer bit is zero. An extended- precision number with an exponent of zero may have an explicit integer bit equal to one. This results in a normalized number, though the exponent is equal to the minimum value. For simplicity, the following discussion treats all three floating-point formats in the same manner, where an exponent value of zero identifies a denormalized number. However, remember the extended-precision format can deviate from this rule. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-17 Introduction 1.6.1 Normalized Numbers Normalized numbers encompass all numbers with exponents laying between the maximum and minimum values. Normalized numbers can be positive or negative. For normalized numbers in single and double precision the implied integer bit is one. In extended precision, the mantissa's MSB, the explicit integer bit, can only be a one (see Figure 1-13); and the exponent can be zero. . MIN < EXPONENT < MAX MANTISSA = ANY BIT PATTERN SIGN OF MANTISSA, 0 OR 1 Figure 1-13. Normalized Number Format 1.6.2 Denormalized Numbers Denormalized numbers represent real values near the underflow threshold. The detection of the underflow for a given data format and operation occurs when the result's exponent is less than or equal to the minimum exponent value. Denormalized numbers can be positive or negative. For denormalized numbers in single and double precision the implied integer bit is a zero. In extended precision, the mantissa's MSB, the explicit integer bit, can only be a zero (see Figure 1-14). . EXPONENT = 0 MANTISSA = ANY NONZERO BIT PATTERN SIGN OF MANTISSA, 0 OR 1 Figure 1-14. Denormalized Number Format Traditionally, the detection of underflow causes floating-point number systems to perform a "flush-to-zero". This leaves a large gap in the number line between the smallest magnitude normalized number and zero. The IEEE 754 standard implements gradual underflows: the result mantissa is shifted right (denormalized) while the result exponent is incremented until reaching the minimum value. If all the mantissa bits of the result are shifted off to the right during this denormalization, the result becomes zero. Usually a gradual underflow limits the potential underflow damage to no more than a round-off error. This underflow and denormalization description ignores the effects of rounding and the user-selectable rounding modes. Thus, the large gap in the number line created by "flush-to-zero" number systems is filled with representable (denormalized) numbers in the IEEE "gradual underflow" floating-point number system. Since the extended-precision data format has an explicit integer bit, a number can be formatted with a nonzero exponent, less than the maximum value, and a zero integer bit. The IEEE 754 standard does not define a zero integer bit. Such a number is an unnormalized number. Hardware does not directly support denormalized and unnormalized numbers, but implicitly supports them by trapping them as unimplemented data types, allowing efficient conversion in software. 1-18 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction 1.6.3 Zeros Zeros can be positive or negative and represent the real values + 0.0 and - 0.0 (see Figure 1-15). . EXPONENT = 0 MANTISSA = 0 SIGN OF MANTISSA, 0 OR 1 Figure 1-15. Zero Format 1.6.4 Infinities Infinities can be positive or negative and represent real values that exceed the overflow threshold. A result's exponent greater than or equal to the maximum exponent value indicates the overflow for a given data format and operation. This overflow description ignores the effects of rounding and the user-selectable rounding models. For single- and double-precision infinities the fraction is a zero. For extended-precision infinities, the mantissa's MSB, the explicit integer bit, can be either one or zero (see Figure 1-16). . EXPONENT = MAXIMUM MANTISSA = 0 SIGN OF MANTISSA, 0 OR 1 Figure 1-16. Infinity Format 1.6.5 Not-A-Numbers When created by the FPU, NANs represent the results of operations having no mathematical interpretation, such as infinity divided by infinity. All operations involving a NAN operand as an input return a NAN result. When created by the user, NANs can protect against unitialized variables and arrays or represent user-defined data types. For extendedprecision NANs, the mantissa's MSB, the explicit integer bit, can be either one or zero (see Figure 1-17). . EXPONENT = MAXIMUM MANTISSA = ANY NONZERO BIT PATTERN SIGN OF MANTISSA, 0 OR 1 Figure 1-17. Not-A-Number Format The FPU implements two different types of NANs identified by the value of the MSB of the mantissa for single- and double-precision, and the MSB of the mantissa minus one for extended-precision. If the bit is set, it is a nonsignaling NAN, otherwise, it is an SNAN. An MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-19 Introduction SNAN can be used as an escape mechanism for a user-defined, non-IEEE data type. The FPU never creates an SNAN resulting from an operation. The IEEE specification defines NAN processing used as an input to an operation. A nonsignaling NAN must be returned when using an SNAN as an input and there is a disabled SNAN trap. The FPU does this by using the source SNAN, setting the MSB of the mantissa, and storing the resulting nonsignaling NAN in the destination. Because of the IEEE formats for NANs, the result of setting an SNAN MSB is always a nonsignaling NAN. When the FPU creates a NAN, the NAN always contains the same bit pattern in the mantissa. All bits of the mantissa are ones for any precision. When the user creates a NAN, any nonzero bit pattern can be stored in the mantissa. 1.6.6 Data Format and Type Summary Tables 1-4 through 1-6 summarize the data type specifications for single-, double-, and extended-precision data formats. Packed decimal real formats support all data types except denormalized numbers. Table 1-7 summarizes the data types for the packed decimal real format. 1-20 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction Table 1-4. Single-Precision Real Format Summary Data Format Data Format 31 30 s 23 22 e 0 f Field Size In Bits Sign (s) 1 Biased Exponent (e) 8 Fraction (f) 23 Total 32 Interpretation of Sign Positive Fraction s=0 Negative Fraction s=1 Normalized Numbers Bias of Biased Exponent +127 ($7F) Range of Biased Exponent 0 < e < 255 ($FF) Range of Fraction Zero or Nonzero Fraction 1.f sx Relation to Representation of Real Numbers (-1) 2e-127 x 1.f Denormalized Numbers Biased Exponent Format Minimum 0 ($00) Bias of Biased Exponent +126 ($7E) Range of Fraction Nonzero Fraction 0.f (-1)s x 2-126 x 0.f Relation to Representation of Real Numbers Signed Zeros Biased Exponent Format Minimum 0 ($00) Fraction 0.f = 0.0 Signed Infinities Biased Exponent Format Maximum 255 ($FF) Fraction 0.f = 0.0 NANs Sign Don't Care Biased Exponent Format Maximum 255 ($FF) Fraction Nonzero Representation of Fraction Nonsignaling Signaling Nonzero Bit Pattern Created by User Fraction When Created by FPCP 0.1xxxx...xxxx 0.0xxxx...xxxx xxxxx...xxxx 11111...1111 Approximate Ranges Maximum Positive Normalized 3.4 x 1038 Minimum Positive Normalized 1.2 x 10-38 Minimum Positive Denormalized 1.4 x 10-45 MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-21 Introduction Table 1-5. Double-Precision Real Format Summary Data Format 63 62 s 52 51 e 0 f Field Size (in Bits) Sign (s) 1 Biased Exponent (e) 11 Fraction (f) 52 Total 64 Interpretation of Sign Positive Fraction s=0 Negative Fraction s=1 Normalized Numbers Bias of Biased Exponent +1023 ($3FF) Range of Biased Exponent 0 < e < 2047 ($7FF) Range of Fraction Zero or Nonzero Fraction 1.f (-1)s x 2e-1023 x 1.f Relation to Representation of Real Numbers Denormalized Numbers Biased Exponent Format Minimum 0 ($000) Bias of Biased Exponent +1022 ($3FE) Range of Fraction Nonzero Fraction 0.f (-1) x 2-1022 x 0.f s Relation to Representation of Real Numbers Signed Zeros Biased Exponent Format Minimum 0 ($00) Fraction (Mantissa/Significand) 0.f = 0.0 Signed Infinities Biased Exponent Format Maximum 2047 ($7FF) Fraction 0.f = 0.0 NANs Sign 0 or 1 Biased Exponent Format Maximum 255 ($7FF) Fraction Nonzero Representation of Fraction Nonsignaling Signaling Nonzero Bit Pattern Created by User Fraction When Created by FPCP 1xxxx...xxxx 0xxxx...xxxx xxxxx...xxxx 11111...1111 Approximate Ranges 1-22 Maximum Positive Normalized 18 x 10308 Minimum Positive Normalized 2.2 x 10-308 Minimum Positive Denormalized 4.9 x 10-324 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction Table 1-6. Extended-Precision Real Format Summary Data Format 95 94 s 80 79 e z 64 63 62 f i 0 Field Size (in Bits) Sign (s) 1 Biased Exponent (e) 15 Zero, Reserved (u) 16 Explicit Integer Bit (j) 1 Mantissa (f) 63 Total 96 Interpretation of Unused Bits Input Don't Care Output All Zeros Interpretation of Sign Positive Mantissa s=0 Negative Mantissa s=1 Normalized Numbers Bias of Biased Exponent +16383 ($3FFF) Range of Biased Exponent 0 < = e < 32767 ($7FFF) Explicit Integer Bit 1 Range of Mantissa Zero or Nonzero Mantissa (Explicit Integer Bit and Fraction ) 1.f Relation to Representation of Real Numbers (-1)s x 2e-16383 x 1.f Denormalized Numbers Biased Exponent Format Minimum 0 ($0000) Bias of Biased Exponent +16383 ($3FFF) Explicit Integer Bit 0 Range of Mantissa Nonzero Mantissa (Explicit Integer Bit and Fraction ) 0.f Relation to Representation of Real Numbers (-1)s x 2-16383 x 0.f Signed Zeros Biased Exponent Format Minimum 0 ($0000) Mantissa (Explicit Integer Bit and Fraction ) 0.0 Signed Infinities Biased Exponent Format Maximum Explicit Integer Bit Don't Care Mantissa (Explicit Integer Bit and Fraction ) MOTOROLA 32767 ($7FFF) x.000...0000 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-23 Introduction Table 1-6. Extended-Precision Real Format Summary (Continued) NANs Sign Don't Care Explicit Integer Bit Don't Care Biased Exponent Format Maximum 32767 ($7FFF) Mantissa Nonzero Representation of Fraction Nonsignaling Signaling Nonzero Bit Pattern Created by User Fraction When Created by FPCP x.1xxxx...xxxx x.0xxxx...xxxx x.xxxxx...xxxx 1.11111...1111 Approximate Ranges Maximum Positive Normalized 1.2 x 104932 Minimum Positive Normalized 1.7 x 10-4932 Minimum Positive Denormalized 3.7 x 104951 Table 1-7. Packed Decimal Real Format Summary Data Type SM SE Y Y 3-Digit Exponent 1-Digit Integer 16-Digit Fraction Infinity 0/1 1 1 1 $FFF $XXXX $00...00 NAN 0/1 1 1 1 $FFF $XXXX Nonzero SNAN 0/1 1 1 1 $FFF $XXXX Nonzero +Zero 0 0/1 X X $000-$999 $XXX0 $00...00 -Zero 1 0/1 X X $000-$999 $XXX0 $00...00 +In-Range 0 0/1 X X $000-$999 $XXX0-$XXX9 $00...01-$99...99 -In-Range 1 0/1 X X $000-$999 $XXX0-$XXX9 $00...01-$99...99 A packed decimal real data format with the SE and both Y bits set, an exponent of $FFF, and a nonzero 16-bit decimal fraction is a NAN. When the FPU uses this format, the fraction of the NAN is moved bit- by-bit into the extended-precision mantissa of a floating-point data register. The exponent of the register is set to signify a NAN, and no conversion occurs. The MSB of the most significant digit in the decimal fraction (the MSB of digit 15) is a don't care, as in extended-precision NANs, and the MSB of minus one of digit 15 is the SNAN bit. If the NAN bit is a zero, then it is an SNAN. If a non-decimal digit ($A - $F) appears in the exponent of a zero, the number is a true zero. The FPU does not detect non-decimal digits in the exponent, integer, or fraction digits of an in-range packed decimal real data format. These non-decimal digits are converted to binary in the same manner as decimal digits; however, the result is probably useless although it is repeatable. Since an in-range number cannot overflow or underflow when converted to extended precision, conversion from the packed decimal real data format always produces normalized extended-precision numbers. 1-24 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction 1.7 ORGANIZATION OF DATA IN REGISTERS The following paragraphs describe data organization within the data, address, and control registers. 1.7.1 Organization of Integer Data Formats in Registers Each integer data register is 32 bits wide. Byte and word operands occupy the lower 8- and 16-bit portions of integer data registers, respectively. Long- word operands occupy the entire 32 bits of integer data registers. A data register that is either a source or destination operand only uses or changes the appropriate lower 8 or 16 bits (in byte or word operations, respectively). The remaining high-order portion does not change and goes unused. The address of the least significant bit (LSB) of a long-word integer is zero, and the MSB is 31. For bit fields, the address of the MSB is zero, and the LSB is the width of the register minus one (the offset). If the width of the register plus the offset is greater than 32, the bit field wraps around within the register. Figure 1-18 illustrates the organization of various data formats in the data registers. An example of a quad word is the product of a 32-bit multiply or the quotient of a 32-bit divide operation (signed and unsigned). Quad words may be organized in any two integer data registers without restrictions on order or pairing. There are no explicit instructions for the management of this data format, although the MOVEM instruction can be used to move a quad word into or out of registers. Binary-coded decimal (BCD) data represents decimal numbers in binary form. Although there are many BCD codes, the BCD instructions of the M68000 family support two formats, packed and unpacked. In these formats, the LSBs consist of a binary number having the numeric value of the corresponding decimal number. In the unpacked BCD format, a byte defines one decimal number that has four LSBs containing the binary value and four undefined MSBs. Each byte of the packed BCD format contains two decimal numbers; the least significant four bits contain the least significant decimal number and the most significant four bits contain the most significant decimal number. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-25 Introduction . 31 1 30 LSB MSB 31 NOT USED 31 7 0 MSB LSB LOW-ORDER WORD MSB 31 BYTE LSB 16-BIT WORD 0 MSB LSB LONG WORD 63 LONG WORD 32 ANY DX MSB 31 QUAD WORD 0 LSB ANY DY 31 0 OFFSET BIT FIELD (0 < OFFSET < 32, 0 < WIDTH _< 32) WIDTH* 8 4 7 3 UNDEFINED 31 BIT (0 _< MODULO (OFFSET) < 31,OFFSET OF 0 = MSB) 0 15 NOT USED 31 0 8 0 LEAST SIGNIFICANT DIGIT 7 4 MOST SIGNIFICANT DIGIT UNPACKED BCD 0 3 LEAST SIGNIFICANT DIGIT PACKED BCD * IF WIDTH + OFFSET > 32, BIT FIELD WRAPS AROUND WITHIN THE REGISTER. Figure 1-18. Organization of Integer Data Formats in Data Registers Because address registers and stack pointers are 32 bits wide, address registers cannot be used for byte-size operands. When an address register is a source operand, either the loworder word or the entire long-word operand is used, depending upon the operation size. When an address register is the destination operand, the entire register becomes affected, despite the operation size. If the source operand is a word size, it is sign-extended to 32 bits and then used in the operation to an address register destination. Address registers are primarily for addresses and address computation support. The instruction set includes instructions that add to, compare, and move the contents of address registers. Figure 1-19 illustrates the organization of addresses in address registers. 31 16 15 SIGN-EXTENDED 0 16-BIT ADDRESS OPERAND 31 0 FULL 32-BIT ADDRESS OPERAND Figure 1-19. Organization of Integer Data Formats in Address Registers 1-26 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction Control registers vary in size according to function. Some control registers have undefined bits reserved for future definition by Motorola. Those particular bits read as zeros and must be written as zeros for future compatibility. All operations to the SR and CCR are word-size operations. For all CCR operations, the upper byte is read as all zeros and is ignored when written, despite privilege mode. The alternate function code registers, supervisor function code (SFC) and data function code (DFC), are 32-bit registers with only bits 0P2 implemented. These bits contain the address space values for the read or write operands of MOVES, PFLUSH, and PTEST instructions. Values transfer to and from the SFC and DFC by using the MOVEC instruction. These are long-word transfers; the upper 29 bits are read as zeros and are ignored when written. 1.7.2 Organization of Integer Data Formats in Memory The byte-addressable organization of memory allows lower addresses to correspond to higher order bytes. The address N of a long-word data item corresponds to the address of the highest order wordUs MSB. The lower order word is located at address N + 2, leaving the LSB at address N + 3 (see Figure 1-20). Organization of data formats in memory is consistent with the M68000 family data organization. The lowest address (nearest $00000000) is the location of the MSB, with each successive LSB located at the next address (N + 1, N + 2, etc.). The highest address (nearest $FFFFFFFF) is the location of the LSB. . 31 23 15 7 0 LONG WORD $00000000 WORD $00000000 BYTE $00000000 WORD $00000002 BYTE $00000001 BYTE $00000002 BYTE $00000003 LONG WORD $00000004 WORD $00000004 BYTE $00000004 WORD $00000006 BYTE $00000005 BYTE $00000006 BYTE $00000007 LONG WORD $FFFFFFFC WORD $FFFFFFFC BYTE $FFFFFFFC BYTE $FFFFFFFD WORD $FFFFFFFE BYTE $FFFFFFFE BYTE $FFFFFFFF Figure 1-20. Memory Operand Addressing MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-27 Introduction Figure 1-21 illustrates the organization of IU data formats in memory. A base address that selects one byte in memory, the base byte, specifies a bit number that selects one bit, the bit operand, in the base byte. The MSB of the byte is seven. The following conditions specify a bit field operand: 1. A base address that selects one byte in memory. 2. A bit field offset that shows the leftmost (base) bit of the bit field in relation to the MSB of the base byte. 3. A bit field width that determines how many bits to the right of the base bit are in the bit field. The MSB of the base byte is bit field offset 0; the LSB of the base byte is bit field offset 7; and the LSB of the previous byte in memory is bit field offset - 1. Bit field offsets may have values between 2 - 31 to 231 - 1, and bit field widths may range from 1 to 32 bits. A 16-byte block operand, supported by the MOVE16 instruction, has a block of 16 bytes, aligned to a 16-byte boundary. An address that can point to any byte in the block specifies this operand. 1-28 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Introduction . 7 0 7 BYTE n - 1 0 7 7 6 5 4 3 2 1 0 0 7 BIT DATA BASE BIT 0 7 0 BIT FIELD DATA 0 1 2 3....w-1 BYTE n WIDTH OFFSET OFFSET ...-3 -2 -1 0 1 2... BASE ADDRESS 0 7 0 7 BYTE n - 1 0 BYTE n + 2 0 7 BYTE n - 1 7 BYTE n + 1 BIT NUMBER ADDRESS 7 0 7 MSB BYTE n LSB 0 7 BYTE n + 1 0 BYTE DATA BYTE n + 2 ADDRESS 7 0 7 BYTE n - 1 0 7 0 7 0 7 BYTE n + 2 WORD INTEGER 0 WORD DATA BYTE n + 3 ADDRESS 7 0 7 0 7 BYTE n - 1 0 7 0 7 0 7 0 LONG-WORD DATA BYTE n + 4 LONG-WORD INTEGER ADDRESS 0 7 7 0 7 0 7 0 7 0 7 0 BYTE n - 1 QUAD-WORD DATA QUAD-WORD INTEGER BYTE n + 8 7 0 7 0 7 BYTE n - 1 0 7 0 7 0 7 0 16-BYTE BLOCK (ALIGNED TO 16-BYTE BOUNDARY) 16-BYTE BLOCK BYTE n + 16 7 0 7 BYTE n - 1 4 3 MSD 0 7 LSD 0 7 BYTE n + 1 BYTE n + 2 0 PACKED BCD DATA ADDRESS 7 0 7 BYTE n - 1 4 3 XX 0 7 MSD 4 3 XX 0 7 LSD 0 BYTE n + 2 UNPACKED BCD DATA ADDRESS Figure 1-21. Memory Organization for Integer Operands MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 1-29 Introduction 1.7.3 Organization of Fpu Data Formats in Registers and Memory The eight, 80-bit floating-point data registers are analogous to the integer data registers and are completely general purpose (i.e., any instruction may use any register). The MC68040 supports only some data formats and types in hardware. Table 1-8 lists the data formats supported by the MC68040. Table 1-8. MC68040 FPU Data Formats and Data Types Data Formats SingleDouble- ExtendedPrecision Precision Precision Real Real Real Number Types PackedDecimal Real Byte Integer Word Integer LongWord Integer Normalized Zero Infinity NAN Denormalized Unnormalized NOTES: * = Data Format/Type Supported by On-Chip MC68040 FPU Hardware = Data Format/Type Supported by Software (MC68040FPSP) Figure 1-22 illustrates the floating-point data format for the single- , double-, and extendedprecision binary real data organization in memory. . 7 0 7 0 7 BYTEn -1 07 SINGLE-PRECISION REAL 0 7 07 0 7 0 7 0 BYTEn +4 ADDRESS 7 0 7 0 7 0 7 0 BYTEn -1 DOUBLE-PRECISION REAL BYTEn +8 ADDRESS 7 0 7 0 7 07 0 7 0 7 0 BYTEn -1 EXTENDED-PRECISION REAL BYTEn +12 Figure 1-22. Organization of FPU Data Formats in Memory 1-30 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA SECTION 2 ADDRESSING CAPABILITIES Most operations take asource operand and destination operand, compute them, and store the result in the destination location. Single-operand operations take a destination operand, compute it, and store the result in the destination location. External microprocessor references to memory are either program references that refer to program space or data references that refer to data space. They access either instruction words or operands (data items) for an instruction. Program space is the section of memory that contains the program instructions and any immediate data operands residing in the instruction stream. Data space is 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; these accesses classify as program references. 2.1 INSTRUCTION FORMAT M68000 family instructions consist of at least one word; some have as many as 11 words. Figure 2-1 illustrates the general composition of an instruction. The first word of the instruction, called the simple effective address operation word, specifies the length of the instruction, the effective addressing mode, and the operation to be performed. The remaining words, called brief and full extension words, further specify the instruction and operands. These words can be floating-point command words, conditional predicates, immediate operands, extensions to the effective addressing mode specified in the simple effective address operation word, branch displacements, bit number or bit field specifications, special register specifications, trap operands, pack/unpack constants, or argument counts. 15 0 SINGLE EFFECTIVE ADDRESS 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 2-1. Instruction Word General Format MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-1 Addressing Capabilities An instruction specifies the function to be performed with an operation code and defines the location of every operand. Instructions specify an operand location by register specification, the instruction's register field holds the register's number; by effective address, the instruction's effective address field contains addressing mode information; or by implicit reference, the definition of the instruction implies the use of specific registers. The single effective address operation word format is the basic instruction word (see Figure 2-2). The encoding of the mode field 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 opcode 111. Some indexed or indirect addressing modes use a combination of the simple effective address operation word followed by a brief extension word. Other indexed or indirect addressing modes consist of the simple effective address operation word and a full extension word. The longest instruction is a MOVE instruction with a full extension word for both the source and destination effective addresses and eight other extension words. It also contains 32-bit base displacements and 32-bit outer displacements for both source and destination addresses. Figure 2-2 illustrates the three formats used in an instruction word; Table 2-1 lists the field definitions for these three formats. SINGLE EFFECTIVE ADDRESS OPERATION WORD FORMAT 15 14 13 12 11 10 9 8 7 6 X X X X X X X X X X 5 4 3 2 1 0 EFFECTIVE ADDRESS MODE REGISTER BRIEF EXTENSION WORD FORMAT 15 D/A 14 13 12 REGISTER 11 W/L 10 9 SCALE 8 0 7 6 5 4 3 DISPLACEMENT 2 1 0 2 1 I/IS 0 FULL EXTENSION WORD FORMAT 15 D/A 14 13 12 REGISTER 11 W/L 10 9 8 7 6 5 4 SCALE 1 BS IS BD SIZE BASE DISPLACEMENT (0, 1, OR 2 WORDS) OUTER DISPLACEMENT (0, 1, OR 2 WORDS) 3 0 Figure 2-2. Instruction Word Specification Formats 2-2 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities Table 2-1. Instruction Word Format Field Definitions Field Definition Instruction Mode Addressing Mode Register General Register Number Extensions D/A Index Register Type 0 = Dn 1 = An W/L Word/Long-Word Index Size 0 = Sign-Extended Word 1 = Long Word Scale Scale Factor 00 = 1 01 = 2 10 = 4 11 = 8 BS Base Register Suppress 0 = Base Register Added 1 = Base Register Suppressed IS Index Suppress 0 = Evaluate and Add Index Operand 1 = Suppress Index Operand BD SIZE Base Displacement Size 00 = Reserved 01 = Null Displacement 10 = Word Displacement 11 = Long Displacement I/IS Index/Indirect Selection Indirect and Indexing Operand Determined in Conjunction with Bit 6, Index Suppress For effective addresses that use a full extension word format, the index suppress (IS) bit and the index/indirect selection (I/IS) field determine the type of indexing and indirect action. Table 2-2 lists the index and indirect operations corresponding to all combinations of IS and I/IS values. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-3 Addressing Capabilities Table 2-2. IS-I/IS Memory Indirect Action Encodings Operation IS Index/Indirect 0 000 No Memory Indirect Action 0 001 Indirect Preindexed with Null Outer Displacement 0 010 Indirect Preindexed with Word Outer Displacement 0 011 Indirect Preindexed with Long Outer Displacement 0 100 Reserved 0 101 Indirect Postindexed with Null Outer Displacement 0 110 Indirect Postindexed with Word Outer Displacement 0 111 Indirect Postindexed with Long Outer Displacement 1 000 No Memory Indirect Action 1 001 Memory Indirect with Null Outer Displacement 1 010 Memory Indirect with Word Outer Displacement 1 011 Memory Indirect with Long Outer Displacement 1 100-111 Reserved 2.2 EFFECTIVE ADDRESSING MODES 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. A register field within an instruction can specify the register to be used; an instruction's effective address field can contain addressing mode information; or the instruction's definition can imply the use of a specific register. 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 detailed register descriptions. An instruction's addressing mode specifies the value of an operand, a register that contains the operand, or how to derive the effective address of an operand in memory. Each addressing mode has an assembler syntax. Some instructions imply the addressing mode for an operand. These instructions include the appropriate fields for operands that use only one addressing mode. 2-4 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.1 Data Register Direct Mode In the data register direct mode, the effective address field specifies the data register containing the operand. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = Dn Dn 000 REG. NO. 0 OPERAND DATA REGISTER 2.2.2 Address Register Direct Mode In the address register direct mode, the effective address field specifies the address register containing the operand. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = An An 001 REG. NO. 0 ADDRESS REGISTER OPERAND 2.2.3 Address Register Indirect Mode In the address register indirect mode, the operand is in memory. The effective address field specifies the address register containing the address of the operand in memory. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An) (An) 010 REG. NO. 0 31 ADDRESS REGISTER 0 OPERAND POINTER POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-5 Addressing Capabilities 2.2.4 Address Register Indirect with Postincrement Mode In the address register indirect with postincrement mode, the operand is in memory. The effective address field specifies the address register containing the address of the operand in memory. 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, respectively. Coprocessors may support incrementing 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 incremented by two to keep the stack pointer aligned to a word boundary. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An) + SIZE (An) + 011 REG. NO. 0 31 0 CONTENTS ADDRESS REGISTER SIZE OPERAND LENGTH ( 1, 2, OR 4) + 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY 2-6 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.5 Address Register Indirect with Predecrement Mode In the address register indirect with predecrement mode, the operand is in memory. The effective address field specifies the address register containing the address of the operand in memory. Before the operand address is used, it is decremented by one, two, or four depending on the operand size: byte, word, or long word, respectively. 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 to keep the stack pointer aligned to a word boundary. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An)-SIZE - (An) 100 REG. NO. 0 31 0 CONTENTS ADDRESS REGISTER OPERAND LENGTH ( 1, 2, OR 4) SIZE 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-7 Addressing Capabilities 2.2.6 Address Register Indirect with Displacement Mode In the address register indirect with displacement mode, the operand is in memory. The sum of the address in the address register, which the effective address specifies, plus the signextended 16-bit displacement integer in the extension word is the operand's address in memory. Displacements are always sign-extended to 32 bits prior to being used in effective address calculations. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An) + d16 (d16,An) 101 REG. NO. 1 31 0 CONTENTS ADDRESS REGISTER 31 0 15 SIGN EXTENDED DISPLACEMENT INTEGER + 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY 2-8 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.7 Address Register Indirect with Index (8-Bit Displacement) Mode This addressing mode requires one extension word that contains an 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 operand's address is the sum of the address register's contents; the sign-extended displacement value in the extension word's low-order eight bits; and the index register's sign-extended contents (possibly scaled). The user must specify the address register, the displacement, and the index register in this mode. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An) + (Xn) + d8 (d 8 ,An, Xn.SIZE*SCALE) 110 REG. NO. 1 31 0 ADDRESS REGISTER CONTENTS 31 DISPLACEMENT 7 SIGN EXTENDED 0 31 INDEX REGISTER SCALE + INTEGER 0 SIGN-EXTENDED VALUE SCALE VALUE X 31 OPERAND POINTER + 0 CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-9 Addressing Capabilities 2.2.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 operand's address is the sum of the contents of the address register, the base displacement, and the scaled contents of the sign-extended index register. In this mode, the address register, the index register, and the displacement are all optional. The effective address is zero if there is no specification. This mode provides a data register indirect address when there is no specific address register and the index register is a data register. . EA = (An) + (Xn) + bd (bd,An,Xn.SIZE*SCALE) 110 REG. NO. 1,2, OR 3 GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: 31 0 ADDRESS REGISTER CONTENTS 31 BASE DISPLACEMENT 0 31 INDEX REGISTER SCALE + SIGN-EXTENDED VALUE 0 SIGN-EXTENDED VALUE SCALE VALUE X 31 OPERAND POINTER + 0 CONTENTS POINTS TO MEMORY 2-10 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.9 Memory Indirect Postindexed Mode In this mode, both the operand and its address are in memory. The processor calculates an intermediate indirect memory address using a base address register and base displacement. 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 omitting a displacement or suppressing an element, its value is zero in the effective address calculation. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (An + bd) + Xn.SIZE*SCALE + od ([bd,An],Xn.SIZE*SCALE,od) 110 REG. NO. 1,2,3,4, OR 5 31 0 ADDRESS REGISTER CONTENTS 31 BASE DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 0 INTERMEDIATE ADDRESS CONTENTS POINTS TO 31 0 VALUE AT INDIRECT MEMORY ADDRESS MEMORY 31 INDEX REGISTER 0 SIGN-EXTENDED VALUE SCALE SCALE VALUE 31 OUTER DISPLACEMENT X 0 + SIGN-EXTENDED VALUE 0 31 OPERAND POINTER + CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-11 Addressing Capabilities 2.2.10 Memory Indirect Preindexed Mode In this mode, both the operand and its address are in memory. The processor calculates an intermediate indirect memory address using a base address register, a base displacement, 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 omitting a displacement or suppressing an element, its value is zero in the effective address calculation. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (bd + An) + Xn.SIZE*SCALE + od ([bd, An, Xn.SIZE*SCALE], od) 110 REG. NO. 1,2,3,4, OR 5 31 0 ADDRESS REGISTER CONTENTS 31 BASE DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 INDEX REGISTER 0 SIGN-EXTENDED VALUE SCALE SCALE VALUE SCALE VALUE X + 31 0 INTERMEDIATE ADDRESS CONTENTS POINTS TO 31 0 VALUE AT INDIRECT MEMORY ADDRESS MEMORY 31 OUTER DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY 2-12 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.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 program counter (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. This is a program reference allowed only for reads. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (PC) + d16 (d16 ,PC) 111 010 1 31 0 CONTENTS PROGRAM COUNTER 31 0 15 SIGN EXTENDED DISPLACEMENT INTEGER + 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-13 Addressing Capabilities 2.2.12 Program Counter Indirect with Index (8-Bit Displacement) Mode This mode is similar to the mode described in 2.2.7 Address Register Indirect with Index (8-Bit Displacement) Mode, except the PC is the base register. The operand is in memory. The operand's address is the sum of the address in the PC, the sign-extended displacement integer in the extension word's lower eight bits, and the sized, scaled, and sign-extended index operand. The value in the PC is the address of the extension word. This is a program reference allowed only for reads. The user must include the displacement, the PC, and the index register when specifying this addressing mode. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (PC) + (Xn) + d 8 (d8,PC,Xn.SIZE*SCALE) 111 011 1 0 31 CONTENTS PROGRAM COUNTER 31 7 SIGN EXTENDED DISPLACEMENT 0 + INTEGER 31 0 SIGN-EXTENDED VALUE INDEX REGISTER SCALE VALUE SCALE X 31 OPERAND POINTER + 0 CONTENTS POINTS TO MEMORY 2-14 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.13 Program Counter Indirect with Index (Base Displacement) Mode This mode is similar to the mode described in 2.2.8 Address Register Indirect with Index (Base Displacement) Mode, except the PC is 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 operand's address is the sum of the contents of the PC, the base displacement, and the scaled contents of the sign-extended index register. The value of the PC is the address of the first extension word. This is a program reference allowed only for reads. In this mode, the PC, the displacement, and the index register are optional. The user must supply the assembler notation ZPC (a zero value PC) to show 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 as the index register. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (PC) + (Xn) + bd (bd, PC, Xn. SIZE*SCALE) 111 011 1,2, OR 3 31 0 CONTENTS PROGRAM COUNTER 31 DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 INDEX REGISTER 0 SIGN-EXTENDED VALUE SCALE VALUE SCALE X 31 OPERAND POINTER + 0 CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-15 Addressing Capabilities 2.2.14 Program Counter Memory Indirect Postindexed Mode This mode is similar to the mode described in 2.2.9 Memory Indirect Postindexed Mode, but the PC is 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 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 to yield the effective address. The value of the PC used in the calculation is the address of the first extension word. This is a program reference allowed only for reads. In the syntax for this mode, brackets enclose the values used to calculate the intermediate memory address. All four user-specified values are optional. The user must supply the assembler notation ZPC (a zero value PC) to show 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 omitting a displacement or suppressing an element, its value is zero in the effective address calculation. GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (bd + PC) + Xn.SIZE*SCALE + od ([bd,PC],Xn.SIZE*SCALE,od) 111 011 1,2,3,4, or 5 31 0 CONTENTS PROGRAM COUNTER 31 0 + SIGN-EXTENDED VALUE BASE DISPLACEMENT 31 0 INTERMEDIATE ADDRESS CONTENTS POINTS TO 31 MEMORY 0 VALUE AT INDIRECT MEM. ADDRESS IN PROG. SPACE 31 0 SIGN-EXTENDED VALUE INDEX REGISTER SCALE X SCALE VALUE 31 OUTER DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 OPERAND POINTER + 0 CONTENTS POINTS TO MEMORY 2-16 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.15 Program Counter Memory Indirect Preindexed Mode This mode is similar to the mode described in 2.2.10 Memory Indirect Preindexed Mode, but the PC is 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, and the scaled contents of an index register. The processor accesses a long word at immediate indirect memory address and adds the optional outer displacement to yield the effective address. The value of the PC is the address of the first extension word. This is a program reference allowed only for reads. In the syntax for this mode, brackets enclose the values used to calculate the intermediate memory address. All four user-specified values are optional. The user must supply the assembler notation ZPC showing 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 omitting a displacement or suppressing an element, its value is zero in the effective address calculation. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA = (bd + PC) + Xn.SIZE*SCALE + od ([bd,PC,Xn.SIZE*SCALE],od) 111 011 1,2,3,4, or 5 31 0 CONTENTS PROGRAM COUNTER 31 0 + SIGN-EXTENDED VALUE BASE DISPLACEMENT 31 0 SIGN-EXTENDED VALUE INDEX REGISTER X SCALE VALUE SCALE + 31 0 INTERMEDIATE ADDRESS INDIRECT MEMORY ADDRESS POINTS TO 31 0 VALUE AT INDIRECT MEM. ADDRESS IN PROG. SPACE MEMORY 31 OUTER DISPLACEMENT 0 + SIGN-EXTENDED VALUE 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY MOTOROLA OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-17 Addressing Capabilities 2.2.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. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA GIVEN (xxx).W 111 000 1 31 15 SIGN-EXTENDED EXTENSION WORD 0 EXTENSION VALUE 31 0 CONTENTS OPERAND POINTER POINTS TO MEMORY OPERAND 2.2.17 Absolute Long Addressing Mode In this addressing mode, the operand is in memory, and the operand's address occupies the two extension words following the instruction word in memory. The first extension word contains the high-order part of the address; the second contains the low-order part of the address. . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: EA GIVEN (xxx).L 111 001 2 15 FIRST EXTENSION WORD 0 ADDRESS HIGH 15 0 ADDRESS LOW SECOND EXTENSION WORD 31 OPERAND POINTER 0 CONTENTS POINTS TO MEMORY 2-18 OPERAND M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.2.18 Immediate Data In this addressing mode, the operand is in one or two extension words. Table 2-3 lists the location of the operand within the instruction word format. The immediate data format is as follows: . GENERATION: ASSEMBLER SYNTAX: EA MODE FIELD: EA REGISTER FIELD: NUMBER OF EXTENSION WORDS: OPERAND GIVEN # 111 100 1,2,4, OR 6, EXCEPT FOR PACKED DECIMAL REAL OPERANDS Table 2-3. Immediate Operand Location Operation Length Byte Location Low-order byte of the extension word. Word The entire extension word. Long Word High-order word of the operand is in the first extension word; the low-order word is in the second extension word. Single-Precision In two extension words. Double-Precision In four extension words. Extended-Precision In six extension words. Packed-Decimal Real In six extension words. 2.3 EFFECTIVE ADDRESSING MODE SUMMARY Effective addressing modes are grouped according to the use of the mode. Data addressing modes refer to data operands. Memory addressing modes refer to memory operands. Alterable addressing modes refer to alterable (writable) operands. Control addressing modes refer to memory operands without an associated size. These categories sometimes combine to form new categories that are more restrictive. Two combined classifications are alterable memory (addressing modes that are both alterable and memory addresses) and data alterable (addressing modes that are both alterable and data). Table 2-4 lists a summary of effective addressing modes and their categories. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-19 Addressing Capabilities Table 2-4. Effective Addressing Modes and Categories Syntax Mode Field Reg. Field Dn An 000 001 reg. no. reg. no. X -- -- -- -- -- X X (An) (An)+ -(An) (d16,An) 010 011 100 101 reg. no. reg. no. reg. no. reg. no. X X X X X X X X X -- -- X X X X X (d8,An,Xn) (bd,An,Xn) 110 110 reg. no. reg. no. X X X X X X X X ([bd,An],Xn,od) ([bd,An,Xn],od) 110 110 reg. no. reg. no. X X X X X X X X (d16,PC) 111 010 X X X -- (d8,PC,Xn) (bd,PC,Xn) 111 111 011 011 X X X X X X -- -- ([bd,PC],Xn,od) ([bd,PC,Xn],od) 111 111 011 011 X X X X X X X X Absolute Data Addressing Short Long (xxx).W (xxx).L 111 111 000 000 X X X X X X -- -- Immediate # 111 100 X X -- -- Addressing Modes Register Direct Data Address Register Indirect Address Address with Postincrement Address with Predecrement Address with Displacement Address Register Indirect with Index 8-Bit Displacement Base Displacement Memory Indirect Postindexed Preindexed Program Counter Indirect with Displacement Program Counter Indirect with Index 8-Bit Displacement Base Displacement Program Counter Memory Indirect Postindexed Preindexed 2-20 Data Memory Control Alterable M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.4 BRIEF EXTENSION WORD FORMAT 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, which is upward compatible with newer members, can be executed on the newer microprocessor without change. Brief extension word formats are encoded with information that allows the CPU32, MC68020, MC68030, and MC68040 to distinguish the basic M68000 family architecture's new address extensions. Figure 2-3 illustrates these brief extension word formats. The encoding for SCALE used by the CPU32, MC68020, MC68030, and MC68040 is a compatible extension of the M68000 family architecture. A value of zero for SCALE is the same encoding for both extension words. Software that uses this encoding is compatible with all processors in the M68000 family. Both brief extension word formats do not contain the other values of SCALE. Software can be easily migrated in an upwardcompatible direction, with downward support only for nonscaled addressing. If the MC68000 were to execute an instruction that encoded a scaling factor, the scaling factor would be ignored and would not access the desired memory address. The earlier microprocessors do not recognize the brief extension word formats implemented by newer processors. Although they can detect illegal instructions, they do not decode invalid encodings of the brief extension word formats as exceptions. 15 D/A 14 13 12 REGISTER 11 W/L 10 0 9 0 8 0 7 6 5 4 3 2 DISPLACEMENT INTEGER 1 0 1 0 (a) MC68000, MC68008, and MC68010 15 D/A 14 13 12 REGISTER 11 W/L 10 9 SCALE 8 0 7 6 5 4 3 2 DISPLACEMENT INTEGER (b) CPU32, MC68020, MC68030, and MC68040 Figure 2-3. M68000 Family Brief Extension Word Formats MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-21 Addressing Capabilities 2.5 FULL EXTENSION ADDRESSING MODES The full extension word format provides additional addressing modes for the MC68020, MC68030, and MC68040. There are four elements common to these full extension addressing modes: a base register (BR), an index register (Xn), a base displacement (bd), and an outer displacement (od). Each of these four elements can be suppressed independently of each other. However, at least one element must be active and not suppressed. When an element is suppressed, it has an effective value of zero. BR can be suppressed through the BS field of the full extension word format. The encoding of bits 0-5 in the single effective address word format (see Figure 2-2) selects BR as either the PC when using program relative addressing modes, or An when using non-program relative addressing modes. The value of the PC is the address of the extension word. For the non-program relative addressing modes, BR is the contents of a selected An. SIZE and SCALE can be used to modify Xn. The W/L field in the full extension format selects the size of Xn as a word or long word. The SCALE field selects the scaling factor, shifts the value of the Xn left multiplying the value by 1, 2, 4, or 8, respectively, without actually changing the value. Scaling can be used to calculate the address of arrayed structures. Figure 2-4 illustrates the scaling of an Xn. The bd and od can be either word or long word. The size of od is selected through the encoding of the I/IS field in the full extension word format (refer to Table 2-2). There are two main modes of operation that use these four elements in different ways: no memory indirect action and memory indirect. The od is provided only for using memory indirect addressing modes of which there are three types: with preindex, with postindex, and with index suppressed. 2-22 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities . SYNTAX: MOVE.B (A5, A6.L*SCALE),(A7) WHERE A5 = ADDRESS OF ARRAY STRUCTURE A6 = INDEX NUMBER OF ARRAY ITEM A7 = STACK POINTER SIMPLE ARRAY (SCALE = 1) 7 RECORD OF 2 BYTES (SCALE = 2) 0 A6 = 0 7 0 A6 = 0 1 2 1 3 RECORD OF 4 BYTES (SCALE = 4) 7 RECORD OF 8 BYTES (SCALE = 8) 0 A6 = 0 7 0 A6 = 0 1 1 NOTE: Regardless of array structure, software increments index by the appropriate amount to point to next record. Figure 2-4. Addressing Array Items MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-23 Addressing Capabilities 2.5.1 No Memory Indirect Action Mode No memory indirect action mode uses BR, Xn with its modifiers, and bd to calculate the address of the required operand. Data register indirect (Dn) and absolute address with index (bd,Xn.SIZE*SCALE) are examples of the no memory indirect action mode. Figure 2-5 illustrates the no memory indirect action mode. BR Xn bd Addressing Mode S S S Not Applicable S S A Absolute Addressing Mode S A S Register Indirect S A A Register Indirect with Constant Index An S S Address Register Indirect An S A Address Register Indirect with Constant Index An A S Address Register Indirect with Variable Index An A A Address Register Indirect with Constant and Variable Index PC S S PC Relative PC S A PC Relative with Constant Index PC A S PC Relative with Variable Index PC A A PC Relative with Constant and Variable Index NOTE: S indicates suppressed and A indicates active. . An or PC bd.BD SIZE Xn.SIZE*SCALE OPERAND Figure 2-5. No Memory Indirect Action 2-24 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities 2.5.2 Memory Indirect Modes Memory indirect modes fetch two operands from memory. The BR and bd evaluate the address of the first operand, intermediate memory pointer (IMP). The value of IMP and the od evaluates the address of the second operand. There are three types of memory indirect modes: pre-index, post-index, and index register suppressed. Xn and its modifiers can be allocated to determine either the address of the IMP (pre-index) or to the address of the second operand (post-index). 2.5.2.1 MEMORY INDIRECT WITH PREINDEX. The Xn is allocated to determine the address of the IMP. Figure 2-6 illustrates the memory indirect with pre-indexing mode. BR Xn bd od IMP Addressing Mode Operand Addressing Mode S A S S Register Indirect Memory Pointer Directly to Data Operand S A S A Register Indirect Memory Pointer as Base with Displacement to Data Operand S A A S Register Indirect with Constant Index Memory Pointer Directly to Data Operand S A A A Register Indirect with Constant Index Memory Pointer as Base with Displacement to Data Operand An A S S Address Register Indirect with Variable Index Memory Pointer Directly to Data Operand An A S A Address Register Indirect with Variable Index Memory Pointer as Base with Displacement to Data Operand An A A S Address Register Indirect with Constant and Variable Index Memory Pointer Directly to Data Operand An A A A Address Register Indirect with Constant and Variable Index Memory Pointer as Base with Displacement to Data Operand PC A S S PC Relative with Variable Index Memory Pointer Directly to Data Operand PC A S A PC Relative with Variable Index Memory Pointer as Base with Displacement to Data Operand PC A A S PC Relative with Constant and Variable Index Memory Pointer Directly to Data Operand PC A A A PC Relative with Constant and Variable Index Memory Pointer as Base with Displacement to Data Operand NOTE: S indicates suppressed and A indicates active. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-25 Addressing Capabilities . An or PC bd.BD SIZE od.OD SIZE OPERAND Xn.SIZE*SCALE IMP Figure 2-6. Memory Indirect with Preindex 2.5.2.2 MEMORY INDIRECT WITH POSTINDEX. The Xn is allocated to evaluate the address of the second operand. Figure 2-7 illustrates the memory indirect with post-indexing mode. BR Xn bd od IMP Addressing Mode Operand Addressing Mode S A S S -- -- S A S A -- -- S A A S Absolute Addressing Mode Memory Pointer with Variable Index to Data Operand S A A A Absolute Addressing Mode Memory Pointer with Constant and Variable Index to Data Operand An A S S Address Register Indirect Memory Pointer with Variable Index to Data Operand An A S A Address Register Indirect Memory Pointer with Constant and Variable Index to Data Operand An A A S Address Register Indirect with Constant Index Memory Pointer with Variable Index to Data Operand An A A A Address Register Indirect with Constant Index Memory Pointer with Constant and Variable Index to Data Operand PC A S S PC Relative Memory Pointer with Variable Index to Data Operand PC A S A PC Relative Memory Pointer with Constant and Variable Index to Data Operand PC A A S PC Relative with Constant Index Memory Pointer with Variable Index to Data Operand PC A A A PC Relative with Constant Index Memory Pointer with Constant and Variable Index to Data Operand NOTE: S indicates suppressed and A indicates active. 2-26 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities . An or PC bd.BD SIZE od.OD SIZE IMP od.OD SIZE OPERAND Figure 2-7. Memory Indirect with Postindex 2.5.2.3 MEMORY INDIRECT WITH INDEX SUPPRESSED. The Xn is suppressed. Figure 2-8 illustrates the memory indirect with index suppressed mode. BR Xn bd od IMP Addressing Mode Operand Addressing Mode S S S S -- -- S S S A -- -- S S A S Absolute Addressing Mode Memory Pointer Directly to Data Operand S S A A Absolute Addressing Mode Memory Pointer as Base with Displacement to Data Operand An S S S Address Register Indirect Memory Pointer Directly to Data Operand An S S A Address Register Indirect Memory Pointer as Base with Displacement to Data Operand An S A S Address Register Indirect with Constant Index Memory Pointer Directly to Data Operand An S A A Address Register Indirect with Constant Index Memory Pointer as Base with Displacement to Data Operand PC S S S PC Relative Memory Pointer Directly to Data Operand PC S S A PC Relative Memory Pointer as Base with Displacement to Data Operand PC S A S PC Relative with Constant Index Memory Pointer Directly to Data Operand PC Relative with Constant Index Memory Pointer as Base with Displacement to Data Operand PC S A A NOTE: S indicates suppressed and A indicates active. . An or PC bd.BD SIZE od.OD SIZE IMP OPERAND Figure 2-8. Memory Indirect with Index Suppress MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-27 Addressing Capabilities 2.6 OTHER DATA STRUCTURES Stacks and queues are common data structures. The M68000 family implements a system stack and instructions that support user stacks and queues. 2.6.1 System Stack Address register seven (A7) is the system stack pointer. Either the user stack pointer (USP), the interrupt stack pointer (ISP), or the master stack pointer (MSP) is active at any one time. Refer to Section 1 Introduction for details on these stack pointers. 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-size operands moved to or from the stack. In long-word-organized memory, aligning the stack pointer on a long-word address significantly increases the efficiency of stacking exception frames, subroutine calls and returns, and other stacking operations. The user can implement stacks with the address register indirect with postincrement and predecrement addressing modes. With an address register the user can implement a stack that fills either from high memory to low memory or from low memory to high memory. Important consideration are: * Use the predecrement mode to decrement the register before using its contents as the pointer to the stack. * Use the postincrement mode to increment the register after using its contents as the pointer to the stack. * Maintain the stack pointer correctly when byte, word, and long-word items mix in these stacks. To implement stack growth from high memory to low memory, use -(An) to push data on the stack and (An) + to pull data from the stack. For this type of stack, after either a push or a pull operation, the address register points to the top item on the stack. . An LOW MEMORY (FREE) TOP OF STACK BOTTOM OF STACK HIGH MEMORY 2-28 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Addressing Capabilities To implement stack growth from low memory to high memory, use (An) + to push data on the stack and -(An) to pull data from the stack. After either a push or pull operation, the address register points to the next available space on the stack. . LOW MEMORY BOTTOM OF STACK An TOP OF STACK (FREE) HIGH MEMORY 2.6.2 Queues The user can implement queues, groups of information waiting to be processed, with the address register indirect with postincrement or predecrement addressing modes. Using a pair of address registers, the user implements a queue that fills either from high memory to low memory or from low memory to high memory. Two registers are used because the queues get pushed from one end and pulled from the other. One address register contains the put pointer; the other register the get pointer. To implement growth of the queue from low memory to high memory, use the put address register to put data into the queue and the get address register to get data from the queue. After a put operation, the put address register points to the next available space in the queue; 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; the unchanged put address register points to the next available space in the queue. . GET (Am) + PUT (An) + LOW MEMORY LAST GET (FREE) 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, do this before performing the put or get operation. Subtracting the buffer length (in bytes) from the register adjusts the address register. To implement growth of the queue from high memory to low memory, use the put address register indirect to put data into the queue and get address register indirect to get data from the queue. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 2-29 Addressing Capabilities After a put operation, the put address register points to the last item placed in the queue; 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 placed in the queue. . PUT - (An) GET - (Am) LOW MEMORY (FREE) 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. Then the relevant address register should be checked and adjusted, if necessary. Adding the buffer length (in bytes) to the address register contents adjusts the address register. 2-30 M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA SECTION 3 INSTRUCTION SET SUMMARY This section briefly describes the M68000 family instruction set, using Motorola,s assembly language syntax and notation. It includes instruction set details such as notation and format, selected instruction examples, and an integer condition code discussion. The section concludes with a discussion of floating-point details such as computational accuracy, conditional test definitions, an explanation of the operation table, and a discussion of not-anumbers (NANs) and postprocessing. 3.1 INSTRUCTION SUMMARY Instructions form a set of tools that perform the following types of operations: Data Movement Program Control Integer Arithmetic System Control Logical Operations Cache Maintenance Shift and Rotate Operations Multiprocessor Communications Bit Manipulation Memory Management Bit Field Manipulation Floating-Point Arithmetic Binary-Coded Decimal Arithmetic The following paragraphs describe in detail the instruction for each type of operation. Table 3-1 lists the notations used throughout this manual. In the operand syntax statements of the instruction definitions, the operand on the right is the destination operand. MOTOROLA M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 3-1 Instruction Set Summary Table 3-1. Notational Conventions Single- And Double Operand Operations + Arithmetic addition or postincrement indicator. - Arithmetic subtraction or predecrement indicator. x Arithmetic multiplication. / Arithmetic division or conjunction symbol. ~ Invert; operand is logically complemented. Logical AND V Logical OR Logical exclusive OR Source operand is moved to destination operand. Two operands are exchanged. Any double-operand operation. tested sign-extended Operand is compared to zero and the condition codes are set appropriately. All bits of the upper portion are made equal to the high-order bit of the lower portion. Other Operations TRAP STOP 10 If then else Equivalent to Format /Offset Word (SSP); SSP - 2 SSP; PC (SSP); SSP - 4 SSP; SR (SSP); SSP - 2 SSP; (Vector) PC Enter the stopped state, waiting for interrupts. The operand is BCD; operations are performed in decimal. Test the condition. If true, the operations after "then"are performed. If the condition is false and the optional "else"clause is present, the operations 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. Register Specifications An Ax, Ay Dc Data register D7-D0, used during compare. Dh, Dl Data register's high- or low-order 32 bits of product. Dn Any Data Register n (example: D5 is data register 5) Dr, Dq Du Dx, Dy MRn Rn Rx, Ry Xn 3-2 Any Address Register n (example: A3 is address register 3) Source and destination address registers, respectively. Data register's remainder or quotient of divide. Data register D7-D0, used during update. Source and destination data registers, respectively. Any Memory Register n. Any Address or Data Register Any source and destination registers, respectively. Index Register M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL MOTOROLA Instruction Set Summary Table 3-1. Notational Conventions (Continued) Data Format And Type + inf B, W, L Positive Infinity Operand Data Format: Byte (B), Word (W), Long (L), Single (S), Double (D), Extended (X), or Packed (P). Specifies a signed integer data type (twos complement) of byte, word, or long word. D Double-precision real data format (64 bits). k A twos complement signed integer (-64 to +17) specifying a number's format to be stored in the packed decimal format. P Packed BCD real data format (96 bits, 12 bytes). S Single-precision real data format (32 bits). X Extended-precision real data format (96 bits, 16 bits unused). - inf Negative Infinity Subfields and Qualifiers # or # Immediate data following the instruction word(s). () Identifies an indirect address in a register. [] Identifies an indirect address in memory. bd Base Displacement ccc Index into the MC68881/MC68882 Constant ROM dn Displacement Value, n Bits Wide (example: d16 is a 16-bit displacement). LSB Least Significant Bit LSW Least Significant Word MSB Most Significant Bit MSW Most Significant Word od SCALE SIZE {offset:width} Outer Displacement A scale factor (1, 2, 4, or 8 for no-word, word, long-word, or quad-word scaling, respectively). The index register's size (W for word, L for long word). Bit field selection. Register Names CCR Condition Code Register (lower byte of status register) DFC Destination Function Code Register FPcr Any Floating-Point System Control Register (FPCR, FPSR, or FPIAR) FPm, FPn IC, DC, IC/DC MMUSR Any Floating-Point Data Register specified as the source or destination, respectively. Instruction, Data, or Both Caches MMU Status Register PC Program Counter Rc Any Non Floating-Point Control Register SFC SR MOTOROLA Source Function Code Register Status Register M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL 3-3 Instruction Set Summary Table 3-1. Notational Conventions (Concluded) Register Codes * General Case C Carry Bit in CCR cc Condition Codes from CCR FC Function Code N Negative Bit in CCR U Undefined, Reserved for Motorola Use. V Overflow Bit in CCR X Extend Bit in CCR Z Zero Bit in CCR -- Not Affected or Applicable. Stack Pointers ISP Supervisor/Interrupt Stack Pointer MSP Supervisor/Master Stack Pointer SP Active Stack Pointer SSP Supervisor (Master or Interrupt) Stack Pointer USP User Stack Pointer Miscellaneous