Est. 1979 Advanced

Assembler (68K)

The assembly language of Motorola's 68000 family, a clean, orthogonal 32-bit instruction set that powered the Macintosh, Amiga, Atari ST, Sega Genesis and a generation of Unix workstations.

Created by Motorola (MACSS project; principal architect Tom Gunter)

Paradigm Assembly, Imperative, Low-level
Typing None (untyped); operand size chosen per instruction with .b, .w and .l suffixes
First Appeared 1979
Latest Version No formal standard; the instruction set grew through the 68010 and 68020 to the 68060 (1994), the last 680x0 CPU Motorola designed

Assembler (68K) is the assembly language of the Motorola 68000 and its successors, a processor family usually called “68K” or “680x0”. Motorola introduced the MC68000 in September 1979. It combined a 32-bit instruction set, sixteen 32-bit registers and a flat address space with a 16-bit external data bus. Programmers who had struggled with the 8-bit chips of the 1970s, or with Intel’s segmented 8086, found a regular and readable assembly language. The 68000 went on to power the Apple Macintosh, the Commodore Amiga, the Atari ST, the Sega Genesis, arcade boards, laser printers and the first generation of Unix workstations. For about a decade, 68K assembly was one of the most widely written machine languages in the world. It is still written today by demoscene coders, retro game developers and embedded engineers.

History & Origins

From the 6800 to MACSS

Motorola’s first widely produced microprocessor was the 8-bit 6800, introduced in 1974. By late 1976 its sales were stagnant. Colin Crook, then an operations manager at Motorola, knew that Intel was building a 16-bit successor to the 8080 (the 8086) and that Zilog was rumoured to be doing the same (the Z8000). He decided not to build a similar chip. Motorola would instead aim for the high end of the market, and that meant a design with some 32-bit features.

Crook set up the MACSS project (Motorola Advanced Computer System on Silicon) and hired Tom Gunter as its principal architect. Gunter began forming the team in January 1977. The team dropped compatibility with the 6800 entirely and took the PDP-11, the most popular minicomputer of the day, as its model. Like the PDP-11, the new instruction set would be orthogonal: operations and addressing modes would combine freely rather than being tied to particular registers. Microcode, then common in minicomputers and mainframes, made that practical on a single chip.

To fit a 64-pin package, the design was a hybrid. It had a 32-bit instruction set architecture, but 16-bit ALUs implemented it, and it had a 16-bit data bus and a 24-bit address bus. Motorola called the part a “16-bit” microprocessor. The software view was 32-bit from the start.

Tools Before Silicon

The assembly language existed before the chip was on sale. Motorola’s M68000 cross assembler is written in ANSI FORTRAN IV. It carries a 1978 copyright and was built to run on a PDP-11 under RT-11. Individual routines in its source are dated from 8 December 1978 to April 1979. It is a two-pass assembler, and it refers users to the separate “M68000 Cross Macro Assembler Manual” for the instruction set. Motorola’s MC68000 16-Bit Microprocessor User’s Manual (preliminary edition) is dated 1 September 1979, the month the processor was formally introduced.

Initial samples followed in February 1980, and production chips were available over the counter that November at 4, 6 and 8 MHz. Along with the samples, Motorola offered the MC68000 Design Module development board. Its ROMs contained Motorola’s MacsBug debugger, which Apple later used on early Macintosh computers. In 1981 Motorola added the MC68000 Educational Computer Board. It shipped with the TUTOR monitor and gave many university students their first hands-on 68000 assembly programming.

The 68K Decade

The 68000 first appeared in expensive machines: multi-user microcomputers, Sun, Apollo and HP workstations, and graphics terminals. As prices fell, it reached personal computers, starting with the Apple Lisa (1983) and Macintosh (1984), then the Amiga and Atari ST (1985). By the late 1980s it was cheap enough for game consoles, starting with Sega’s Genesis/Mega Drive (1988).

On these machines, much of the system software and many games were written, at least in part, in 68K assembly. On the original Macintosh, Bill Atkinson’s QuickDraw library, which drew every window, menu and font, was written entirely in 68000 assembly. On the Amiga, Carl Sassenrath’s Exec kernel provided pre-emptive multitasking in 256 KB of RAM.

Design Philosophy

The 68000 was designed to be pleasant to program by hand and easy for compilers to target:

  • A 32-bit machine from the start. Registers and address arithmetic are 32 bits wide even on the original 68000. Motorola intended the unused upper address bits to let 68000 software run unchanged on later full 32-bit chips.
  • Orthogonality. Most instructions accept most addressing modes for at least one operand. Programmers familiar with the PDP-11 or VAX felt at home. The main departure is that the general registers are split into data and address registers.
  • A minicomputer model. User and supervisor modes, a separate supervisor stack pointer, 256 exception vectors and seven interrupt levels made the chip suitable for multitasking operating systems such as Unix.
  • Big-endian throughout. Multi-byte values are stored most significant byte first, as on the IBM mainframes and in network byte order.

Key Features

Registers

RegisterSizePurpose
D0-D732 bitsData registers: arithmetic, logic, shifts, counters
A0-A632 bitsAddress registers: pointers and base addresses
A7 / SP32 bitsStack pointer. There are separate user (USP) and supervisor (SSP) copies
PC32 bitsProgram counter (24 bits reach the pins on the 68000)
SR16 bitsStatus register: a privileged system byte (trace, supervisor, interrupt mask) and the condition code register (X, N, Z, V, C)

The X (extend) flag is separate from the carry flag. That lets multi-precision arithmetic (ADDX, SUBX, ROXL, ROXR) carry a bit from one step to the next while ordinary compares and branches use C.

Addressing Modes

The 68000 has 56 instructions. Much of the language’s power comes from its addressing modes:

ModeMotorola syntaxMeaning
Data / address register directD0, A0The register itself
Register indirect(A0)Memory at the address in A0
Post-increment(A0)+Use (A0), then add the operand size (1, 2 or 4) to A0
Pre-decrement-(A0)Subtract the operand size, then use (A0)
Displacement16(A0)A0 plus a signed 16-bit offset
Indexed8(A0,D0.W)A0 plus an index register plus a signed 8-bit offset
PC-relativelabel(PC), 8(PC,D2)Relative to the program counter, for position-independent code
Absolute$4000.W, $00FF0000.LA 16- or 32-bit address
Immediate#400A constant stored in the instruction

Most instructions take a size suffix: .b (8-bit byte), .w (16-bit word) or .l (32-bit long). $ marks a hexadecimal number in Motorola syntax.

Idioms

Post-increment addressing and the Z flag set by MOVE make string routines very short:

1
2
3
4
5
; Copy a zero-terminated string from (A0) to (A1)
strcpy:
        move.b  (a0)+,(a1)+     ; copy one byte, advance both pointers
        bne.s   strcpy          ; loop until the byte copied was zero
        rts

The DBcc family (“decrement and branch”) builds counted loops. It stops when the counter reaches -1 rather than 0, so the count is loaded as n - 1:

1
2
3
4
5
; Clear 256 longwords (1 KB) starting at buffer
        lea     buffer,a0
        move.w  #256-1,d0       ; DBRA runs until D0 wraps to -1
.clear  clr.l   (a0)+
        dbra    d0,.clear

Programmers also learned the timing tables. For example, moveq #0,d0 is the usual way to zero a data register. According to Motorola’s 68000 instruction timings, it takes 4 clock cycles, while clr.l d0 takes 6. Both are 2-byte instructions, so the saving comes purely from execution time on the original 68000.

Two Syntaxes

Motorola defined the standard syntax, but Unix toolchains descended from MIT’s work used a different “MIT syntax.” The GNU assembler accepts both:

Motorola syntaxMIT syntax
move.l (a0)+,d0movel a0@+,d0
move.w 8(a0,d1.w),d2movew a0@(8,d1:w),d2
move.l -(sp),d3movel sp@-,d3

Evolution

The instruction set grew over the 680x0 generations, and 68000 code generally runs unchanged on the later chips:

  • 68010 (1982) made instructions restartable after a bus error, which allows virtual memory. It also made MOVE from SR privileged so the chip meets the Popek and Goldberg virtualization requirements, and added a “loop mode” that speeds up tight DBcc loops.
  • 68008 (1982) is a 68000 with an 8-bit data bus. It is best known from the Sinclair QL.
  • 68020 (1984) was fully 32-bit internally. It added 32×32→64-bit multiply, 64÷32-bit divide, bit-field instructions, scaled indexing, memory-indirect addressing and a 256-byte instruction cache. It also removed the 68000’s requirement that word and longword accesses be aligned.
  • 68030 (1987) moved the memory management unit onto the chip and split the instruction and data caches.
  • 68040 (around 1990-91) added an on-chip floating-point unit and 4 KB instruction and data caches.
  • 68060 (1994) was superscalar, with branch prediction. It was the last 680x0 CPU. Motorola then stopped developing the line in favour of PowerPC.

A 24-bit legacy caused trouble along the way. Early Mac OS kept flags in the unused high byte of memory pointers. That worked on the 68000, but it broke on 32-bit chips until Apple shipped “32-bit clean” ROMs, starting with the Macintosh IIci in 1989.

After 1994, the architecture survived in embedded processors. The CPU32-based 683xx microcontrollers, the DragonBall used in Palm handhelds, and Freescale’s ColdFire all use 68K-derived instruction sets. According to Freescale’s November 2010 discontinuance notice, the closure of its Sendai fab ended most remaining classic parts, leaving only the 68SEC000 in production at the time. Some discontinued chips stayed available through distributors, and in 2024 Rochester Electronics reportedly began reproducing the CMOS 68HC000 under licence from NXP.

Current Relevance

68K assembly is a historical language with a surprisingly active community:

  • Retro platforms. Amiga, Atari ST and Sega Genesis developers still write new games and demos. Community projects such as Sonic Retro’s Sonic the Hedgehog disassembly were still being updated in 2026. FPGA re-creations such as the Apollo 68080 core, used in Vampire Amiga accelerators, extend the instruction set further.
  • Tools. vasm by Volker Barthelmann and Frank Wille is a portable, retargetable assembler. It supports the whole M680x0 family (including the 6888x FPU, 68851 MMU, CPU32 and Apollo 68080) and ColdFire, and offers a Devpac-compatible Motorola syntax mode. It writes Amiga hunk, Atari TOS, ELF and Sharp X68000 executables; its current release is v2.0f. EASy68K, an open-source 68000 editor, assembler and simulator for Windows (or Wine), is widely used to teach assembly language. The GNU toolchain also still targets m68k.
  • Operating systems. The Linux kernel still documents and maintains an m68k architecture port.

No official Docker image exists for 68K development. The usual workflow is to cross-assemble with vasm or GNU as on a modern computer and run the result in an emulator or on original hardware.

Why It Matters

The 68000 showed that a microprocessor could offer a clean, minicomputer-style programming model at a price that personal computers could afford. For programmers in the 1980s, 68K assembly was a big step up from 8-bit machine code. It had enough registers to keep work out of memory, addressing modes that matched how C and Pascal compilers think, and a flat address space with no segments. It was the language underneath the first mass-market graphical user interfaces, the Amiga’s multitasking and a whole generation of 16-bit console games. Its regularity is a large part of why hobbyists still choose to write it by hand today.

Timeline

1977
Motorola starts the MACSS (Motorola Advanced Computer System on Silicon) project; Tom Gunter, its principal architect, begins forming his team in January
1978
Motorola writes the M68000 cross assembler in ANSI FORTRAN IV for a PDP-11 host; its source carries a 1978 copyright, and its routines are dated from December 1978 to April 1979
1979
The MC68000 is formally introduced in September; Motorola's preliminary MC68000 16-Bit Microprocessor User's Manual is dated 1 September 1979
1980
Initial 68000 samples ship in February, and production chips are available over the counter in November at 4, 6 and 8 MHz
1982
The 68010 adds restartable instructions for virtual memory and makes MOVE from SR privileged, and the 68008 brings the instruction set to an 8-bit data bus
1984
Apple ships the Macintosh in January; its QuickDraw graphics library is 17,101 lines of 68000 assembly. The same year the 68020 adds 32-bit multiply and divide, bit-field instructions and scaled indexing
1985
The Amiga's Exec kernel, designed and written by Carl Sassenrath, is released on 23 July 1985 as the multitasking core of AmigaOS on the 68000
1988
Sega's Genesis (Mega Drive) uses the 68000 as its main CPU, making 68K assembly a mainstream game-development language
1994
The 68060 is released, and Motorola stops developing the 680x0 line in favour of PowerPC
2010
The Computer History Museum publishes the original MacPaint and QuickDraw source code on 18 July 2010, the first of its historical source code releases

Notable Uses & Legacy

Apple Macintosh (QuickDraw and MacPaint)

Bill Atkinson's QuickDraw graphics library, which drew the original Macintosh user interface, is 17,101 lines in 36 files, all 68000 assembly. MacPaint pairs 5,822 lines of Pascal with 3,583 lines of 68000 assembly for its speed-critical routines.

AmigaOS Exec

Carl Sassenrath's Exec kernel, released in 1985, gave the 68000-based Amiga pre-emptive multitasking in as little as 256 KB of memory, with one fixed address (location 4) pointing to exec.library.

Sega Genesis / Mega Drive games

The console used a 68000 at about 7.6 MHz as its main CPU. Community disassemblies such as Sonic Retro's Sonic the Hedgehog project turn the original ROMs back into buildable 68K assembly source, and are still maintained.

Arcade hardware

Atari's Food Fight (1983) was one of the first 68000-based arcade games. Later platforms such as Sega's System 16 (1985), Capcom's CP System (1988) and SNK's Neo Geo (1990) ran on the 68000.

Unix workstations

The 68000 family powered the first Sun-1, Apollo/Domain and HP 9000 Series 200 workstations, and later Sun-3 and NeXT machines built on the 68020, 68030 and 68040.

Embedded systems and calculators

68000-derived cores ran the first HP LaserJet (1984), Palm OS 1.x-4.x handhelds via the DragonBall, and Texas Instruments' TI-89 and TI-92 graphing calculators, whose users wrote 68K assembly programs for them.

Language Influence

Influenced By

PDP-11

Influenced

CPU32 ColdFire

Running Today

Run examples using the official Docker image:

docker pull
Last updated: