π 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
- Clock: β 13.3 MHz (NTSC), derived from the system clock by the boot
codeβs clock dividers β do not touch
CLK1/CLK2/CLK3(see Memory Map β do-not-touch registers). - Buses: 16-bit external data bus, 24-bit address bus β 16 MB address space. Internally the registers and most operations are 32-bit; a 32-bit memory access is performed as two 16-bit bus cycles.
- Byte order: big-endian (Motorola order) β the most-significant byte is
at the lowest address. This matches the convention the Jaguar ASICs are set to
(
G_END/D_END=$00070007). - Role: the 68000 is the system manager, not the performance path β heavy work belongs to the GPU/DSP/Blitter (see Architecture Overview). For maximum RISC throughput it can be halted to free the bus (see GPU β Performance notes).
- Jaguar memory rules: put the stack near the top of RAM (commonly
$1FFFFC); cartridge programs start at$802000; in the dev environment the lower 16 KB (below$4000) is reserved (see Memory Map). - Jaguar gotchas: the 68000
clr.l <ea>andmove.l β¦,-(An)instructions corrupt writes to GPU/DSP register/RAM space β use the GPU/DSP or Blitter to write there instead (see Hardware Bugs & Warnings). Audio is muted after reset until bit 8 ofJOYSTICKis set.
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
- Operand sizes: byte (8 bits), word (16 bits), long word (32 bits).
- Alignment: instructions and word/long operands must be at even addresses. A word or long access to an odd address raises an address-error exception. Bytes may be at any address.
- Memory layout (big-endian): for a long word at address A, byte A is the most-significant byte and A+3 the least; the word at A is the high word.
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
STOPto 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
- System Architecture Overview β the 68000 as system manager
- Memory Map / Register List β address space,
INT1/INT2, clocks - Hardware Bugs & Warnings β the
clr.l/move.lGPU-space corruption - Cartridges, EEPROM Saves & ROM Building β the
$802000entry point - RISC Instruction Set (GPU/DSP) β the coprocessorsβ very different ISA
- GPU β Performance notes β halting the 68000 to free the bus
β Prev: Connectors, Pinouts & Power Β Β·Β π Home Β Β·Β Next: Object Processor (Tom) βΆ
Jump to: Architecture Β· Memory Map Β· Registers Β· Instructions Β· Glossary Β· CD-ROM