What ColdFire is
ColdFire (Motorola, then Freescale and NXP) is a variable-length RISC-style core that keeps the 68000’s programmer’s model and instruction encoding, so much 68000 code runs unchanged, but it drops instructions that cost hardware,
limits operand sizes and addressing modes on many of the rest, and adds a few new ones. The revisions are named by the instruction set architecture they implement: ISA_A (V2, e.g. MCF5206), ISA_A+ (V3) and
ISA_B (V4) and ISA_C. The decoder offers cfv2 (ISA_A), cfv3 (ISA_A+), cfv4 (ISA_B) and cfc (ISA_C). What the manual says of ISA_C is short: “Added instructions for improved bit manipulation”, and it lists BITREV, BYTEREV, FF1 and STLDSR as “ISA_A+, ISA_C” (CFPRM Rev. 3, section 1 and Table 3-14). It does not say in the text that ISA_C contains every ISA_B instruction (MOV3Q, MVS, MVZ, the byte and word CMP ...); that the decoder’s cfc variant has A, A+ and B together is therefore an assumption, which GNU binutils 2.47 (-m m68k:isa-c) agrees with over all 65,536 first words, not a statement of the manual (the column marks of Table 3-16 were lost in the text extraction). In an ELF file the revision comes from the e_flags ISA field (EM_COLDFIRE = 52).
This page is written from the ColdFire Family Programmer’s Reference Manual, Rev. 3 (Freescale, 03/2005; chapter 3 instruction summary and Table 3-14 “First appeared”, chapter 4 for each instruction’s size and addressing-mode tables, chapter 9 for the opcode map); until 2026-11-18 it was written from memory.
Instructions the 68000 has and ColdFire does not
A word that is one of these on the 68000 is an unavailable instruction here (the status says so, and the note names it): ABCD, SBCD, NBCD and PACK/UNPK (no BCD), MOVEP, DBcc, CHK, EXG,
RTR, TRAPV, RESET, RTD, BKPT, MOVES, the bit-field instructions, CAS and CAS2, CMP2 and CHK2, CALLM and RTM, the coprocessor interface and the 68040 cache and MMU opcodes; also
the memory-to-memory forms ADDX/SUBX on memory and CMPM, the rotates ROL, ROR, ROXL, ROXR, the logical instructions to CCR and SR (ORI, ANDI, EORI), TRAPcc other than TPF. The list is the
manual’s instruction summary (Tables 3-14 and 3-15): an instruction not in it does not exist.
Instructions ColdFire adds
| Mnemonic | Opcode | Revision | What it does |
|---|---|---|---|
MVS | 0111 Dn 1 00 ea (byte), 0111 Dn 1 01 ea (word) | ISA_B | Move with sign extension to a long word in Dn. On the 68000 these opcodes are illegal. |
MVZ | 0111 Dn 1 10 ea (byte), 0111 Dn 1 11 ea (word) | ISA_B | Move with zero extension. |
MOV3Q | 1010 qqq 1 01 ea | ISA_B | Move a 3-bit immediate (−1, or 1 to 7) to a long-word destination. In the A-line of the 68000. |
SATS | $4C80 | Dn | ISA_B | Saturate Dn to the 32-bit range if V is set. |
BITREV | $00C0 | Dn | ISA_A+ and ISA_C | Reverse the 32 bits of Dn. |
BYTEREV | $02C0 | Dn | ISA_A+ and ISA_C | Reverse the four bytes of Dn. |
FF1 | $04C0 | Dn | ISA_A+ and ISA_C | Find the first one bit: Dn gets its position. |
REMS, REMU | $4C41 + word (the 32-bit divide form with Dw ≠ Dx; with Dw = Dx the manual says DIVS or DIVU is executed instead) | ISA_A | Signed and unsigned remainder (not on the MCF5202, MCF5204 and MCF5206). |
HALT | $4AC8 | ISA_A | Halt the core (debug). Privileged. |
PULSE | $4ACC | ISA_A | Drive a pulse on the debug pins. |
STLDSR #data | $40E7 $46FC and the immediate word | ISA_A+ and ISA_C | Push the zero-filled status register, then load the status register with the immediate. Privileged. (On the 68000 the first word is MOVE SR,-(A7).) |
INTOUCH (Ay) | $F428 | Ay | ISA_B | Instruction-fetch touch: prefetch the instruction cache line at (Ay). Privileged. It is cache field 00 of the CPUSHL encoding; GNU names the same word cpushl nc. |
WDEBUG.L ea | $FBC0 | ea and the word $0003 | ISA_A | Write a debug-module control register from a two-longword command in memory; (Ay) and (d16,Ay) only. Privileged. |
MOVE.L USP,Ax, MOVE.L Ay,USP | $4E68 | Ax, $4E60 | Ay | ISA_B | Move to and from the user stack pointer. Privileged. (GNU also has these in isa-aplus: the manual’s tables give ISA_B only.) |
TPF | $51FA (word operand), $51FB (long operand), $51FC (none): the false TRAPcc forms | ISA_A | A no-op that skips its operand (the opcode is TRAPF on the 68020). |
CPUSHL | $F428 | cc<<6 | An (cc = 01 data, 10 instruction, 11 both) | ISA_A | Push and invalidate a cache line; the same encoding as on the 68040. Privileged. |
WDDATA | $FB00 | size<<6 | ea | ISA_A | Write a value to the debug data port (memory alterable modes). |
TAS, MOVE #data,(d16,Ax), MOV3Q, MVS, MVZ, SATS, Bcc.L, BRA.L, BSR.L, byte and word CMP, CMPI, word CMPA | ISA_B | See the next section. |
The V4e FPU instructions are not decoded.
Operand sizes and addressing modes
The decoder (explorer/cpu/m68k/cf.js) applies these limits, each from the instruction’s page in the manual. A word that breaks one is illegal; one that is legal only from a later revision is unavailable. “Data alterable” means Dx, (Ax), (Ax)+, -(Ax), (d16,Ax), (d8,Ax,Xi), (xxx).W and (xxx).L; “memory alterable” is the same without Dx.
| Instruction | Sizes | Source / destination |
|---|---|---|
ADD, SUB, AND, OR | long only | ea,Dx: every mode (AND, OR: not Ay); Dy,ea: memory alterable |
ADDA, SUBA; EOR | long only | every mode; EOR Dy,ea: data alterable |
ADDI, SUBI, ANDI, ORI, EORI, CMPI | long (CMPI: also byte and word from ISA_B) | Dx only |
ADDQ, SUBQ | long only | alterable, including Ax |
ADDX, SUBX, NEG, NEGX, NOT, SWAP, Scc | long (SWAP word, Scc byte) | registers only (ADDX Dy,Dx) |
ASL, ASR, LSL, LSR | long only | register shifts only (no memory shifts) |
BTST, BCHG, BCLR, BSET | byte (memory) or long (Dx) | Dy,ea: data alterable (BTST also the PC-relative modes); #n,ea: Dx, (Ax), (Ax)+, -(Ax), (d16,Ax). The manual does not list #data as a BTST Dy,ea operand; GNU decodes it: the two disagree. |
CLR | byte, word, long | data alterable |
CMP, CMPA | long; byte and word CMP and word CMPA from ISA_B | every mode (the manual’s CMP table has no size footnote, unlike TST) |
MULS, MULU, DIVS, DIVU | word (16-bit operand) and long (32-bit) | word: every mode except Ay; long (and REMS, REMU): Dy, (Ay), (Ay)+, -(Ay), (d16,Ay). No 64-bit forms. |
JMP, JSR, LEA, PEA | unsized | control modes: (Ay), (d16,Ay), (d8,Ay,Xi), (xxx).W/.L, (d16,PC), (d8,PC,Xi) |
MOVE | byte, word, long | destination: Dx, (Ax), (Ax)+, -(Ax), (d16,Ax), (d8,Ax,Xi), (xxx).W/.L. Source and destination together: a source of Dy, Ay, (Ay), (Ay)+, -(Ay) goes to any destination; (d16,Ay) and (d16,PC) to everything except (d8,Ax,Xi) and the absolute modes; every other source ((d8,Ay,Xi), (d8,PC,Xi), absolute, #data) only to Dx, (Ax), (Ax)+, -(Ax); from ISA_B MOVE.B and MOVE.W #data,(d16,Ax) as well. |
MOVEA, MVS, MVZ | word, long (MVS/MVZ byte, word, ISA_B) | every mode |
MOVEM | long only | (Ay) and (d16,Ay) only, both directions |
MOVE to CCR, MOVE to SR | byte (CCR), word (SR) | Dy or #data only; MOVE from SR and from CCR: Dx only |
TST | byte, word, long | every mode; Ax only for word and long |
TAS | byte (ISA_B) | memory alterable (not Dx) |
Bcc, BRA, BSR | byte, word; long (displacement byte $FF) from ISA_B | |
LINK | word only (no LINK.L) |
The multiply-accumulate unit (MAC, EMAC, EMAC_B)
The optional MAC unit uses the A-line ($Axxx), so the decoder shows it only when the ColdFire MAC unit option is set to mac, emac or emac_b (default off: the A-line is an emulator trap). From the manual’s chapters 5 and 6 and the opcode map in chapter 9:
- MAC and MSAC,
MAC.sz Ry.{U,L},Rx.{U,L}SF[,ea&,Rw][,ACCx]: operation word1010 Rx(3) 0 a 0 Rx(1) 00 Ry(4)(bit 8 is 0), extension word withszin bit 11 (0 word, 1 long), the scale factor in bits 10-9 (00 none, 01<<1, 11>>1), bit 8 = 0 for MAC and 1 for MSAC,U/Lxin bit 7,U/Lyin bit 6. With a load the operation word holdsRwand an(Ay),(Ay)+,-(Ay)or(d16,Ay)operand, and the extension wordRxin bits 15-12, the MASK flag in bit 5 andRyin bits 3-0. With the EMAC the accumulator is the extension word’s bit 4 (high) and the operation word’s bit 7 (low; inverted for the load form). - MAAAC, MASAC, MSAAC, MSSAC (EMAC_B, option
emac_b): the EMAC form with extension bits 1-0 = 01 (MAAAC, MSAAC) or 11 (MASAC, MSSAC), bit 8 = 0 for MAAAC and MASAC and 1 for MSAAC and MSSAC, and the second accumulator in bits 3-2. GNU 2.47 has no EMAC_B and decodes these words as plain MAC. - Register moves (
MOVE.L): to the accumulator ($A100| ea, EMAC1010 0 AC 1 00 ea), from it ($A180| Rx),ACCy,ACCx(EMAC), to and fromMACSR($A900,$A980),MACSRtoCCR($A9C0),MASK($AD00,$AD80),ACCext01($AB00,$AB80),ACCext23($AF00,$AF80);MOVCLR.L ACCn,Rx(EMAC,1010 0 AC 1 11 00 Rx). Writing to a MAC register takesDy,Ayor#data.
With the plain MAC unit the single accumulator is written ACC, with the EMAC ACC0 to ACC3. Checked against GNU objdump (m68k:isa-a:mac, isa-b:mac, isa-c:emac); the effects, flags and MACSR modes are not described.
Other differences
- Addressing: only the brief extension word exists (with the scale from ISA_A); the full word with memory indirection is not available. Bit 8 of the word is ignored.
- The sizes and modes of the instructions are limited: see the table above (the decoder flags every violation).
TRAP #nand the stack frame differ (not described).- The control registers
CACR,ACR0toACR3,VBR,RAMBAR,ROMBAR,MBAR,SRandPCare named byMOVEC.
Not described
Known, not yet covered
- Reference: the V4e FPU instructions; the effects, flags and modes of the MAC and EMAC unit (MACSR); the exception stack frame; clock counts.
- Viewer: the V4e FPU is not decoded. The size, mode and revision limits and the MAC unit were compared with GNU objdump 2.47 over every first word (0 unexplained differences; see
checks/results/D-followups.md), but not with a ColdFire core or a second manual revision.
Unknown
- Reference: where the manual and GNU disagree the page follows the manual:
BTST Dy,#data(GNU decodes it),MOVE USPin ISA_A+ (GNU has it), andCMP.B Ay,Dx(listed by the manual, decoded by GNU, here decoded). The manual’s Table 3-16 column marks were lost in the text extraction, soISA_A+is taken as ISA_A plus the four instructions whose “First appeared” entry names it (BITREV, BYTEREV, FF1, STLDSR).