68000 Build environment

Last Updated or created 2024-06-11

For my new SBC I’ll need a machine code build environment.

This is what I’ve setup now.

My main workstation is Linux based. While this setup is Linux based, vasm should work on other operating systems also.

Getting and compiling vasm for 68k

wget http://sun.hasenbraten.de/vasm/release/vasm.tar.gz
tar xzvf vasm.tar.gz
cd vasm
# Building
make CPU=m68k SYNTAX=oldstyle
# Using
./vasmm68k_oldstyle -m68000 -Fbin -dotdir -no-opt source.asm
# this generates a.out

# Dumping the file (byte separated and with a offset of 0x8000)
xxd -g 1 -o 0x8000 a.out | head
00008000: 30 3c aa aa 4e f9 00 00 80 04 00 00 00 00 00 00  0<..N...........
00008010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00008090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

# But my 68k needs an ODD EVEN eeprom 
# so I used another tool - romsplit
git clone https://github.com/ullman/romsplit
cd romsplit
make all
# Using romsplit
./romsplit -s a.out odd.rom even.rom
# Output
xxd -g 1 -o 0x8000 odd | head -1 ; xxd -g 1 -o 0x8000 even | head -1
00008000: 30 aa 4e 00 80 00 00 00 00 00 00 00 00 00 00 00  0.N.............
00008000: 3c aa f9 00 04 00 00 00 00 00 00 00 00 00 00 00  <...............
# Burn these with minipro

Disassemble

m68k-linux-gnu-objdump --disassemble-all --target=binary --architecture=m68k a.out
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *