Amiga Assembly · the code

Every program in the book

224 sources and 223 programs, in folders named exactly as the book names them. Free to use in your own work, commercial or not, under the MIT licence.

Assemble and run a chapter

You need vasm and vlink (assembler and linker), FS-UAE (emulator, with a free Kickstart replacement) and Python 3 (turns a binary into a bootable disk). Open a terminal in the folder and type:

vasmm68k_mot -Fbin -o ch01/rainbow.bin ch01/rainbow.asm
python3 tools/mkadf.py ch01/rainbow.bin ch01/rainbow.adf

Check everything

From the top folder of the full download, this assembles every source again and compares the result with the reference bytes:

python3 tools/checkup.py
python3 verify.py
  • Point the emulator's first floppy drive at the .adf. There is no operating system on that disk: the machine reads the first block, jumps into it, and the screen belongs to your program about a second later.
  • Nothing needs a Commodore ROM: FS-UAE ships with a free Kickstart replacement, and everything in the book boots under it.
  • The .asm files are written by the genNN.py script in each folder. Change the generator, run it, and verify.py makes sure the sources and the book stay in step.
  • Disk images are not in the download: make, or tools/build.sh, builds every disk from the binaries.

Chapter by chapter

Ch.TitleFolderDownload
Part I · Before the first byte
1The machine that arrived too early: what the Amiga is, and why it is programmed this waych01/ch01.zip 25 KB
2Numbers a computer understands: bits, bytes, hexadecimal, and two's complementch02/ch02.zip 8 KB
3Inside the case: the 68000, Agnus, Denise, Paula, the CIAs, and the memory mapch03/ch03.zip 21 KB
4Setting up the development environment on Windows, macOS, and Linuxch04/ch04.zip 1 KB
5Your first program: a coloured screen, assembled, booted, and photographedch05/ch05.zip 7 KB
6Seeing inside the machine: the emulator's debuggerch06/ch06.zip 6 KB
Part II · The 68000 language
7Registers, data sizes, and the shape of a 68000 instructionch07/ch07.zip 13 KB
8Moving data: MOVE and every addressing modech08/ch08.zip 20 KB
9Arithmetic: add, subtract, multiply, divide, and sign extensionch09/ch09.zip 22 KB
10Logic, bits, shifts, and rotatesch10/ch10.zip 23 KB
11Making decisions: the condition codes, Bcc, DBcc, and Sccch11/ch11.zip 28 KB
12Subroutines, the stack, and the stack framech12/ch12.zip 23 KB
13Tables, pointers, and position-independent codech13/ch13.zip 18 KB
14Counting cycles: what an instruction costs on a 7 MHz 68000ch14/ch14.zip 26 KB
15vasm and vlink: labels, macros, includes, sections, and the executablech15/ch15.zip 25 KB
Part III · The copper, the blitter, and the bus
16Taking the machine: switching off the operating system and taking the interruptsch16/ch16.zip 34 KB
17How a frame is built: two standards, 227 colour clocks, and the DMA slot tablech17/ch17.zip 21 KB
18Bitplanes: planar graphics, bitplane pointers, and a screen you can draw onch18/ch18.zip 29 KB
19The display window: DIWSTRT, DDFSTRT, the modulos, and the constants that differch19/ch19.zip 31 KB
20Colour: four thousand and ninety-six colours, measuredch20/ch20.zip 28 KB
21The copper: a coprocessor that waits for the beamch21/ch21.zip 23 KB
22Copper lists that do real work: splits, bars, and lists that write themselvesch22/ch22.zip 29 KB
23Extra Half-Brite and HAM: sixty-four colours, and four thousandch23/ch23.zip 41 KB
24Hardware sprites: eight objects, their DMA, and where they really landch24/ch24.zip 33 KB
25Attached sprites, sprite reuse, and priority against the playfieldch25/ch25.zip 34 KB
26The blitter: four channels, three sources, and two hundred and fifty-six functionsch26/ch26.zip 50 KB
27Blitter graphics: masks, shifts, cookie-cut, and a bob that movesch27/ch27.zip 39 KB
28Blitter fill and blitter linesch28/ch28.zip 44 KB
29Scrolling: fine, coarse, and a playfield wider than the screench29/ch29.zip 42 KB
30Dual playfield and the priority registerch30/ch30.zip 45 KB
31Who owns the bus: the 68000 bus cycle, and who wins each colour clockch31/ch31.zip 48 KB
Part IV · Making it a game machine
32The vertical blank interrupt: the heartbeat of a game at fifty and at sixtych32/ch32.zip 39 KB
33Double buffering, and a frame that never tearsch33/ch33.zip 29 KB
34Reading the world: joystick, mouse, the CIAs, and the keyboardch34/ch34.zip 48 KB
35The CIA timers: measuring time without the operating systemch35/ch35.zip 44 KB
36Paula: four channels, eight-bit samples, period, and volumech36/ch36.zip 2.8 MB
37An engine for sound effects and music, at either frame ratech37/ch37.zip 6.0 MB
38Chip RAM discipline: where things must live, and how to place themch38/ch38.zip 561 KB
39Collisions: CLXDAT, bounding boxes, and detection that holds upch39/ch39.zip 47 KB
40Score, text, and a font drawn by the blitterch40/ch40.zip 46 KB
41Random numbers and game statesch41/ch41.zip 34 KB
Part V · A complete game and a complete demo
42Veldrin I: from the specification to a world that scrollsch42/ch42.zip 87 KB
43Veldrin II: enemies, sound, score, and the finished diskch43/ch43.zip 152 KB
44Two Hundred and Twenty-Seven: copper bars, a scroller, bobs, and musicch44/ch44.zip 173 KB
45Where to go next: three projects, sketchedch45/ch45.zip 43 KB
Part VI · Beyond the A500
46Fifty hertz and sixty: one game, right on bothch46/ch46.zip 86 KB
47AGA I: eight bitplanes, twenty-four-bit colour, and HAM8ch47/ch47.zip 69 KB
48AGA II: fetch modes, wider sprites, and what breaks when you move upch48/ch48.zip 59 KB
49Optimisation: cycles, chip RAM, and the tricks that buy bothch49/ch49.zip 82 KB
Part VII · Giving the machine back
50Living with AmigaOS: opening a screen, and giving the machine backch50/ch50.zip 57 KB
51Loading from disk: the bootblock, trackdisk, and a loader of your ownch51/ch51.zip 73 KB
52Testing on real hardware: real A500s, real monitors, real floppiesch52/ch52.zip 31 KB
53Releasing your work: disk images, WHDLoad, and the scene todaych53/ch53.zip 19 KB
Everything else in the repository
appAappA/appA.zip 177 KB
appBappB/appB.zip 136 KB
appCappC/appC.zip 12 KB
appDappD/appD.zip 16 KB
appEappE/appE.zip 13 KB
toolstools/tools.zip 37 KB

Packed on 2026-10-08 from the repository. Every zip contains the licence.