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.adfCheck 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. | Title | Folder | Download |
|---|---|---|---|
| Part I · Before the first byte | |||
| 1 | The machine that arrived too early: what the Amiga is, and why it is programmed this way | ch01/ | ch01.zip 25 KB |
| 2 | Numbers a computer understands: bits, bytes, hexadecimal, and two's complement | ch02/ | ch02.zip 8 KB |
| 3 | Inside the case: the 68000, Agnus, Denise, Paula, the CIAs, and the memory map | ch03/ | ch03.zip 21 KB |
| 4 | Setting up the development environment on Windows, macOS, and Linux | ch04/ | ch04.zip 1 KB |
| 5 | Your first program: a coloured screen, assembled, booted, and photographed | ch05/ | ch05.zip 7 KB |
| 6 | Seeing inside the machine: the emulator's debugger | ch06/ | ch06.zip 6 KB |
| Part II · The 68000 language | |||
| 7 | Registers, data sizes, and the shape of a 68000 instruction | ch07/ | ch07.zip 13 KB |
| 8 | Moving data: MOVE and every addressing mode | ch08/ | ch08.zip 20 KB |
| 9 | Arithmetic: add, subtract, multiply, divide, and sign extension | ch09/ | ch09.zip 22 KB |
| 10 | Logic, bits, shifts, and rotates | ch10/ | ch10.zip 23 KB |
| 11 | Making decisions: the condition codes, Bcc, DBcc, and Scc | ch11/ | ch11.zip 28 KB |
| 12 | Subroutines, the stack, and the stack frame | ch12/ | ch12.zip 23 KB |
| 13 | Tables, pointers, and position-independent code | ch13/ | ch13.zip 18 KB |
| 14 | Counting cycles: what an instruction costs on a 7 MHz 68000 | ch14/ | ch14.zip 26 KB |
| 15 | vasm and vlink: labels, macros, includes, sections, and the executable | ch15/ | ch15.zip 25 KB |
| Part III · The copper, the blitter, and the bus | |||
| 16 | Taking the machine: switching off the operating system and taking the interrupts | ch16/ | ch16.zip 34 KB |
| 17 | How a frame is built: two standards, 227 colour clocks, and the DMA slot table | ch17/ | ch17.zip 21 KB |
| 18 | Bitplanes: planar graphics, bitplane pointers, and a screen you can draw on | ch18/ | ch18.zip 29 KB |
| 19 | The display window: DIWSTRT, DDFSTRT, the modulos, and the constants that differ | ch19/ | ch19.zip 31 KB |
| 20 | Colour: four thousand and ninety-six colours, measured | ch20/ | ch20.zip 28 KB |
| 21 | The copper: a coprocessor that waits for the beam | ch21/ | ch21.zip 23 KB |
| 22 | Copper lists that do real work: splits, bars, and lists that write themselves | ch22/ | ch22.zip 29 KB |
| 23 | Extra Half-Brite and HAM: sixty-four colours, and four thousand | ch23/ | ch23.zip 41 KB |
| 24 | Hardware sprites: eight objects, their DMA, and where they really land | ch24/ | ch24.zip 33 KB |
| 25 | Attached sprites, sprite reuse, and priority against the playfield | ch25/ | ch25.zip 34 KB |
| 26 | The blitter: four channels, three sources, and two hundred and fifty-six functions | ch26/ | ch26.zip 50 KB |
| 27 | Blitter graphics: masks, shifts, cookie-cut, and a bob that moves | ch27/ | ch27.zip 39 KB |
| 28 | Blitter fill and blitter lines | ch28/ | ch28.zip 44 KB |
| 29 | Scrolling: fine, coarse, and a playfield wider than the screen | ch29/ | ch29.zip 42 KB |
| 30 | Dual playfield and the priority register | ch30/ | ch30.zip 45 KB |
| 31 | Who owns the bus: the 68000 bus cycle, and who wins each colour clock | ch31/ | ch31.zip 48 KB |
| Part IV · Making it a game machine | |||
| 32 | The vertical blank interrupt: the heartbeat of a game at fifty and at sixty | ch32/ | ch32.zip 39 KB |
| 33 | Double buffering, and a frame that never tears | ch33/ | ch33.zip 29 KB |
| 34 | Reading the world: joystick, mouse, the CIAs, and the keyboard | ch34/ | ch34.zip 48 KB |
| 35 | The CIA timers: measuring time without the operating system | ch35/ | ch35.zip 44 KB |
| 36 | Paula: four channels, eight-bit samples, period, and volume | ch36/ | ch36.zip 2.8 MB |
| 37 | An engine for sound effects and music, at either frame rate | ch37/ | ch37.zip 6.0 MB |
| 38 | Chip RAM discipline: where things must live, and how to place them | ch38/ | ch38.zip 561 KB |
| 39 | Collisions: CLXDAT, bounding boxes, and detection that holds up | ch39/ | ch39.zip 47 KB |
| 40 | Score, text, and a font drawn by the blitter | ch40/ | ch40.zip 46 KB |
| 41 | Random numbers and game states | ch41/ | ch41.zip 34 KB |
| Part V · A complete game and a complete demo | |||
| 42 | Veldrin I: from the specification to a world that scrolls | ch42/ | ch42.zip 87 KB |
| 43 | Veldrin II: enemies, sound, score, and the finished disk | ch43/ | ch43.zip 152 KB |
| 44 | Two Hundred and Twenty-Seven: copper bars, a scroller, bobs, and music | ch44/ | ch44.zip 173 KB |
| 45 | Where to go next: three projects, sketched | ch45/ | ch45.zip 43 KB |
| Part VI · Beyond the A500 | |||
| 46 | Fifty hertz and sixty: one game, right on both | ch46/ | ch46.zip 86 KB |
| 47 | AGA I: eight bitplanes, twenty-four-bit colour, and HAM8 | ch47/ | ch47.zip 69 KB |
| 48 | AGA II: fetch modes, wider sprites, and what breaks when you move up | ch48/ | ch48.zip 59 KB |
| 49 | Optimisation: cycles, chip RAM, and the tricks that buy both | ch49/ | ch49.zip 82 KB |
| Part VII · Giving the machine back | |||
| 50 | Living with AmigaOS: opening a screen, and giving the machine back | ch50/ | ch50.zip 57 KB |
| 51 | Loading from disk: the bootblock, trackdisk, and a loader of your own | ch51/ | ch51.zip 73 KB |
| 52 | Testing on real hardware: real A500s, real monitors, real floppies | ch52/ | ch52.zip 31 KB |
| 53 | Releasing your work: disk images, WHDLoad, and the scene today | ch53/ | ch53.zip 19 KB |
| Everything else in the repository | |||
| appA | appA/ | appA.zip 177 KB | |
| appB | appB/ | appB.zip 136 KB | |
| appC | appC/ | appC.zip 12 KB | |
| appD | appD/ | appD.zip 16 KB | |
| appE | appE/ | appE.zip 13 KB | |
| tools | tools/ | tools.zip 37 KB | |
Packed on 2026-10-08 from the repository. Every zip contains the licence.