loading...
All Amiga articles | Back to top

Amiga Bootblock

The Motorola 68000

Amiga 1000 (1985)

The Motorola 68000 is a 16/32-bit processor introduced in 1979. It was very popular in 80s computers, notably:

It was also a popular CPU for arcade games:

And of course, it was the CPU of the SEGA Genesis.

Markey Jester's Motorola 68000 Beginner's Tutorial is useful for getting started with MC68000 assembly code.

For the SEGA Genesis specifics, Matt Phillips's blog bigevilcorporation.co.uk is very helpful. He's working on a new Genesis game, Tanglewood, which looks like a very cool project. Another source is Marc's Realm: Programming the Sega MegaDrive.

Tools

The only tool needed to create a ROM is an MC68000 assembler. The open source assembler vasm built with Motorola-style syntax is appropriate. There doesn't currently seem to be a Windows release of this, so we need to build it ourselves.

It is distributed with a Makefile, so I started the 'Developer Command Prompt for VS 2017' and entered the directory containing the vasm source, and then executed these commands:

makedir obj_win32
nmake -f Makefile.Win32 CPU=m68k SYNTAX=mot

This generates the executable vasmm68k_mot_win32.exe, which we will use to assemble our program.

Andreas Fredriksson (Insomniac, DICE) wrote a couple of Python scripts which I used to generate an Amiga Disk Format (ADF) image from our assembled program.

Hello World

_start:
	dc.b	'D','O','S',0		; disk type
	dc.l	0			; checksum
	dc.l	880			; root block

	; Because this is a bootblock, we will have ExecBase in a6 here

	clr.w	d0
loop:
	addq.w	#1,d0
	move.w	d0,$dff180	; flash screen
	cmp.w	#$fff,d0
	bne	loop
	clr.w	d0
	bra 	loop	

Making an ADF

First we assemble our program:

vasmm68k_mot_win32 demo.asm -Fbin -o demo.o

Then we generate a checksum:

python sum-bootblock.py demo.o demo.sum

And generate the ADF:

python make-adf.py demo.adf demo.sum