🏠 Atari Jaguar Developer Reference β–Έ CPU (68000) β–Έ Motorola 68000 β€” Programmer’s Model

Motorola 68000 β€” Programmer’s Model

The general-purpose CPU at the center of the Jaguar. This page covers the programmer-visible model only β€” registers, data organization, addressing modes, the instruction set, instruction timing, and exception processing β€” with Jaguar-specific details noted inline.

Source: Motorola MC68000 Family Programmer’s Reference Manual (M68000PRM) and MC68000 User’s Manual β€” the canonical, public 68000 architecture. This is not part of the Atari Jaguar documentation set; it is included so the console is documented end-to-end. Cycle counts are clock-cycle figures from Motorola’s timing tables (independent of clock frequency). For exhaustive per-instruction, per-addressing-mode timing matrices, consult Β§8 of the MC68000 User’s Manual.

On this page: The 68000 in the Jaguar Β· Registers Β· Status register Β· Data organization Β· Addressing modes Β· Instruction set Β· Condition codes (cc) Β· Instruction timing Β· Exception processing

The 68000 in the Jaguar

Registers

Register Width Purpose
D0–D7 32-bit Data registers β€” byte (8), word (16) or long (32) operands. Byte/word operations affect only the low 8/16 bits and leave the rest unchanged.
A0–A6 32-bit Address registers β€” pointers/base/index. Operations on address registers are word or long only (word forms are sign-extended to 32 bits) and do not affect the condition codes.
A7 (SP) 32-bit Stack pointer β€” banked by the S bit: the User Stack Pointer (USP) in user mode and the Supervisor Stack Pointer (SSP) in supervisor mode.
PC 24-bit (eff.) Program counter. Instructions must be word-aligned (even addresses).
SR 16-bit Status register (system byte + condition-code byte) β€” see below.

The processor has two privilege states: supervisor (full access, own stack SSP) and user (restricted; certain instructions are privileged). The Jaguar boot code runs in supervisor mode.

Status register

 15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  T   0   S   0   0  I2  I1  I0   0   0   0   X   N   Z   V   C
 └──── system byte β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ └──────── CCR (user byte) β”€β”€β”€β”€β”€β”˜
Bit Name Meaning
15 T Trace β€” when set, a trace exception is taken after each instruction.
13 S Supervisor state (1 = supervisor, 0 = user).
10–8 I2–I0 Interrupt priority mask β€” interrupts at or below this level are inhibited (7 = all but level-7/NMI masked).
4 X Extend β€” used by multi-precision arithmetic (ADDX, SUBX, NEGX, ROXL/R); set like C but not affected by MOVE/logical/compare ops.
3 N Negative (bit set if the result’s MSB is 1).
2 Z Zero (set if the result is zero).
1 V Overflow (signed overflow).
0 C Carry/borrow.

The low byte alone is the CCR (condition-code register). The system byte (T, S, I) is only writable in supervisor mode.

Data organization

Addressing modes

# Mode Syntax Notes
1 Data register direct Dn operand in a data register
2 Address register direct An operand in an address register
3 Address register indirect (An) operand at the address in An
4 …with postincrement (An)+ An advances by operand size after use
5 …with predecrement -(An) An decreases by operand size before use
6 …with displacement d16(An) address = An + sign-extended 16-bit displacement
7 …with index d8(An,Xn) address = An + Xn (.w/.l) + signed 8-bit displacement
8 Absolute short (xxx).W 16-bit address, sign-extended to 24 bits
9 Absolute long (xxx).L full 24/32-bit address
10 PC with displacement d16(PC) address = PC + 16-bit displacement (read-only)
11 PC with index d8(PC,Xn) address = PC + Xn + 8-bit displacement (read-only)
12 Immediate #<data> literal byte/word/long in the instruction stream

SR, CCR, and USP are accessed by dedicated instructions rather than as general effective addresses. Xn (the index) may be a data or address register used as word (sign-extended) or long.

Instruction set

The instruction set groups below list each mnemonic, its operation, the operand sizes it supports, and how it affects the condition codes.

CCR effect key: * = set according to the result Β· β€” = unaffected Β· 0 = always cleared Β· 1 = always set Β· U = undefined. Columns are X N Z V C.

Data movement

Mnemonic Operation Sizes X N Z V C
MOVE Move data, source β†’ destination B W L β€” * * 0 0
MOVEA Move to address register (no flags) W L β€” β€” β€” β€” β€”
MOVEQ Move 8-bit signed immediate β†’ Dn (sign-extended) L β€” * * 0 0
MOVEM Move multiple registers ↔ memory W L β€” β€” β€” β€” β€”
MOVEP Move peripheral data (to alternate bytes) W L β€” β€” β€” β€” β€”
EXG Exchange two registers L β€” β€” β€” β€” β€”
SWAP Swap the two 16-bit halves of Dn W β€” * * 0 0
LEA Load effective address β†’ An L β€” β€” β€” β€” β€”
PEA Push effective address onto the stack L β€” β€” β€” β€” β€”
LINK Allocate a stack frame (An ← SP, SP βˆ’= disp) β€” β€” β€” β€” β€” β€”
UNLK Release a stack frame β€” β€” β€” β€” β€” β€”

Integer arithmetic

Mnemonic Operation Sizes X N Z V C
ADD / ADDA / ADDI / ADDQ Add (A = to addr reg, I = immediate, Q = quick 1–8) B W L * * * * * †
ADDX Add with X (multi-precision) B W L * * * * *
SUB / SUBA / SUBI / SUBQ Subtract B W L * * * * * †
SUBX Subtract with X B W L * * * * *
NEG Negate (0 βˆ’ dest) B W L * * * * *
NEGX Negate with X B W L * * * * *
CLR Set destination to 0 B W L β€” 0 1 0 0
CMP / CMPA / CMPI / CMPM Compare (subtract without storing) B W L β€” * * * *
MULU / MULS 16Γ—16 β†’ 32 multiply (unsigned / signed) W β€” * * 0 0
DIVU / DIVS 32Γ·16 β†’ 16r:16q divide (unsigned / signed) W β€” * * * 0
EXT Sign-extend byte→word or word→long W L — * * 0 0
TST Test operand against zero B W L β€” * * 0 0

† ADDA/SUBA (address-register destination) do not affect the condition codes. ADDX/SUBX clear Z only if the result is non-zero (used for multi-precision).

Logical

Mnemonic Operation Sizes X N Z V C
AND / ANDI Bitwise AND B W L β€” * * 0 0
OR / ORI Bitwise OR B W L β€” * * 0 0
EOR / EORI Bitwise exclusive-OR B W L β€” * * 0 0
NOT Ones-complement B W L β€” * * 0 0

Shift & rotate

Mnemonic Operation Sizes X N Z V C
ASL / ASR Arithmetic shift left / right B W L * * * * *
LSL / LSR Logical shift left / right B W L * * * 0 *
ROL / ROR Rotate (without X) B W L β€” * * 0 *
ROXL / ROXR Rotate through X B W L * * * 0 *

Register-form shifts take a count of 1–8 (immediate) or a count in Dn (mod 64); memory forms shift by one bit and operate on a word only.

Bit manipulation

Mnemonic Operation Sizes X N Z V C
BTST Test a bit (sets Z from the bit) B L β€” β€” * β€” β€”
BSET Test then set a bit B L β€” β€” * β€” β€”
BCLR Test then clear a bit B L β€” β€” * β€” β€”
BCHG Test then change a bit B L β€” β€” * β€” β€”

Z is set from the original value of the addressed bit. Bit number is mod 8 for a memory (byte) destination, mod 32 for a Dn (long) destination.

Binary-coded decimal

Mnemonic Operation Sizes X N Z V C
ABCD Add BCD with X B * U * U *
SBCD Subtract BCD with X B * U * U *
NBCD Negate BCD with X B * U * U *

Program control

Mnemonic Operation Sizes X N Z V C
Bcc Branch conditionally (8/16-bit displacement) B W β€” β€” β€” β€” β€”
BRA Branch always B W β€” β€” β€” β€” β€”
BSR Branch to subroutine B W β€” β€” β€” β€” β€”
DBcc Test cc, decrement & branch (loop primitive) W β€” β€” β€” β€” β€”
Scc Set byte to $FF/$00 per cc B β€” β€” β€” β€” β€”
JMP Jump (any addressing mode) β€” β€” β€” β€” β€” β€”
JSR Jump to subroutine β€” β€” β€” β€” β€” β€”
RTS Return from subroutine β€” β€” β€” β€” β€” β€”
RTR Return and restore CCR β€” * * * * *
NOP No operation β€” β€” β€” β€” β€” β€”

System control (mostly privileged)

Mnemonic Operation Sizes X N Z V C
MOVE to/from SR Move to SR is privileged; from SR reads it W (to SR: * * * * *)
MOVE to/from CCR Set/read the condition codes W * * * * *
ANDI/ORI/EORI to CCR/SR Logical op on CCR (user) or SR (privileged) W * * * * *
MOVE USP Move user stack pointer (privileged) L β€” β€” β€” β€” β€”
RESET Assert the reset line to peripherals (privileged) β€” β€” β€” β€” β€” β€”
RTE Return from exception (privileged) β€” * * * * *
STOP #imm Load SR and stop until interrupt/reset (privileged) β€” * * * * *
TRAP #n Software trap (vectors 32–47) β€” β€” β€” β€” β€” β€”
TRAPV Trap if V set β€” β€” β€” β€” β€” β€”
CHK Trap if Dn < 0 or > bound W β€” * U U U
TAS Test-and-set (atomic, byte) B β€” * * 0 0
ILLEGAL Take the illegal-instruction trap (vector 4) β€” β€” β€” β€” β€” β€”

The Jaguar’s GPU/DSP can be parked with the 68000’s STOP to free the bus β€” see GPU β†’ Performance notes.

Condition codes (cc)

Used by Bcc, DBcc, and Scc (cc selects the test):

cc Test Β  cc Test
T always trueΒΉ Β  F always falseΒΉ
HI unsigned higher Β  LS unsigned lower or same
CC/HS carry clear (β‰₯, unsigned) Β  CS/LO carry set (<, unsigned)
NE not equal (Z=0) Β  EQ equal (Z=1)
VC overflow clear Β  VS overflow set
PL plus (N=0) Β  MI minus (N=1)
GE signed β‰₯ Β  LT signed <
GT signed > Β  LE signed ≀

ΒΉ T/F are not allowed on Bcc (use BRA for β€œalways”); DBT/DBF (a.k.a. DBRA) and ST/SF are valid.

Instruction timing

Timing is given in clock cycles; at the Jaguar’s β‰ˆ13.3 MHz a cycle is β‰ˆ75 ns. The minimum bus (read or write) cycle is 4 clocks, so cycle counts are always multiples of 2 (and usually of 4). Motorola’s notation n(r/w) means n total clock cycles comprising r read and w write bus accesses.

Many instruction times are a base time plus the effective-address (EA) calculation time of the operand. Compute the EA time from the table below and add it where the standard table marks a +.

Effective-address calculation times

Addressing mode Byte/Word Long
Dn, An 0(0/0) 0(0/0)
(An) 4(1/0) 8(2/0)
(An)+ 4(1/0) 8(2/0)
-(An) 6(1/0) 10(2/0)
d16(An) 8(2/0) 12(3/0)
d8(An,Xn) 10(2/0) 14(3/0)
(xxx).W 8(2/0) 12(3/0)
(xxx).L 12(3/0) 16(4/0)
d16(PC) 8(2/0) 12(3/0)
d8(PC,Xn) 10(2/0) 14(3/0)
#<data> 4(1/0) 8(2/0)

Representative instruction times

Register-to-register and the common cases (add the EA time where shown):

Instruction Cycles Β 
MOVE Dn/An → Dn/(An) (reg→reg) 4(1/0)  
MOVE (memory β†’ memory) source EA + dest EA + 4/8 (see Motorola MOVE matrices) Β 
MOVEQ #d,Dn 4(1/0) Β 
ADD/SUB/AND/OR/CMP <ea>,Dn (word) 4(1/0) + EA Β 
ADD/SUB/AND/OR Dn,<ea> (word, to memory) 8(1/1) + EA Β 
long-word <ea>,Dn ALU op 6–8 + EA Β 
ADDQ/SUBQ to Dn/An (word) 4(1/0) / 8(1/0) Β 
CLR/NEG/NOT/TST (word, Dn) 4(1/0) Β 
MULU/MULS (word) 70(1/0)+ (β‰ˆ 38–70, data-dependent) + EA Β 
DIVU 140(1/0)+ (β‰ˆ 76–140) + EA Β 
DIVS 158(1/0)+ (β‰ˆ 90–158) + EA Β 
ASx/LSx/ROx/ROXx Dn (register) 6 + 2Β·n (1/0) where n = shift count Β 
shift/rotate, memory (one bit, word) 8(1/1) + EA Β 
BTST #/Dn,Dn 10/6 (1/0) Β 
BSET/BCLR/BCHG Dn 8/8/8 (long, register) Β 
Bcc taken 10(2/0) Β· not taken: 8(1/0) byte / 12(2/0) word Β 
BSR 18(2/2) Β 
DBcc cc-false (loop taken) 10(2/0) Β· cc-true / count expired: 12–14 Β 
JMP 8–14 (mode-dependent) Β 
JSR 16–22 (mode-dependent) Β 
RTS 16(4/0) Β 
RTE/RTR 20(5/0) Β 
LEA 0 + EA Β· PEA 12(1/2) + EA
LINK 16(2/2) Β· UNLK 12(3/0)
MOVEM (reg→mem / mem→reg) 8/12 + 4 (word) or 8 (long) per register  
NOP 4(1/0) Β 
STOP 4(0/0) Β 
RESET 132(1/0) Β 
TAS (memory) 14(1/1) + EA Β 

These are the standard figures; the complete per-instruction, per-mode matrices (including the full MOVE sourceΓ—destination tables) are in Β§8 of the MC68000 User’s Manual.

Exception processing times

Exception Cycles
Interrupt (autovectored) 44(5/3)
Trap / TRAP #n 34(4/3)
Illegal / unimplemented instruction 34(4/3)
Privilege violation 34(4/3)
TRAPV taken 34(4/3)
CHK (trap taken) 40(4/3) + EA
Trace 34(4/3)
Bus error / address error 50(4/7)
Reset (initial SSP+PC fetch) 40(6/0)

Exception processing

On an exception the 68000 switches to supervisor mode, pushes context onto the SSP, and vectors through a 256-entry vector table at the base of memory (each entry a 32-bit address; vectors 0–1 hold the reset SSP and PC).

Vector Offset Assignment
0 $000 Reset β€” initial SSP
1 $004 Reset β€” initial PC
2 $008 Bus error
3 $00C Address error (odd word/long access)
4 $010 Illegal instruction
5 $014 Divide by zero
6 $018 CHK out of bounds
7 $01C TRAPV
8 $020 Privilege violation
9 $024 Trace
10 $028 Line-A (1010) emulator
11 $02C Line-F (1111) emulator
15 $03C Uninitialised interrupt
24 $060 Spurious interrupt
25–31 $064–$07C Level 1–7 interrupt autovectors
32–47 $080–$0BC TRAP #0 … TRAP #15
64–255 $100–$3FC User interrupt vectors

Interrupts: seven priority levels; the I2–I0 mask in SR inhibits levels at or below its value. Level 7 is non-maskable. On the Jaguar, the video/timer interrupts reach the 68000 through the interrupt-control registers β€” see INT1/INT2 and VI in the Memory Map and the Object Processor refresh interrupt. On a development console the Alpine board’s Stop button generates a non-maskable interrupt.

Keep 68000 interrupt handlers (especially the vertical-blank handler) short β€” a long handler can starve the CD read path; see CD-ROM Programming Guide β†’ the latency rule.

See also


β—€ Prev: Connectors, Pinouts & Power Β Β·Β  🏠 Home Β Β·Β  Next: Object Processor (Tom) β–Ά

Jump to: Architecture Β· Memory Map Β· Registers Β· Instructions Β· Glossary Β· CD-ROM