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)
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
| Register | Size | Purpose |
|---|---|---|
D0-D7 | 32 bits | Data registers: arithmetic, logic, shifts, counters |
A0-A6 | 32 bits | Address registers: pointers and base addresses |
A7 / SP | 32 bits | Stack pointer. There are separate user (USP) and supervisor (SSP) copies |
PC | 32 bits | Program counter (24 bits reach the pins on the 68000) |
SR | 16 bits | Status 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:
| Mode | Motorola syntax | Meaning |
|---|---|---|
| Data / address register direct | D0, A0 | The 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) |
| Displacement | 16(A0) | A0 plus a signed 16-bit offset |
| Indexed | 8(A0,D0.W) | A0 plus an index register plus a signed 8-bit offset |
| PC-relative | label(PC), 8(PC,D2) | Relative to the program counter, for position-independent code |
| Absolute | $4000.W, $00FF0000.L | A 16- or 32-bit address |
| Immediate | #400 | A 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:
| |
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:
| |
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 syntax | MIT syntax |
|---|---|
move.l (a0)+,d0 | movel a0@+,d0 |
move.w 8(a0,d1.w),d2 | movew a0@(8,d1:w),d2 |
move.l -(sp),d3 | movel 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 SRprivileged so the chip meets the Popek and Goldberg virtualization requirements, and added a “loop mode” that speeds up tightDBccloops. - 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
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.