01 March 2018

A Motorola 68000 assembler, disassembler, and simulator made in Python.

View Chris-Johnston/Easier68k on GitHub

Easier68k documentation can be found here.

Part of my degree included a class on Hardware, in which we were taught an introduction to assembly programming with the Motorola 68000 CPU. The class used assembler and simulator software called EASy68k.

This software was notoriously difficult to use, and had significant usability issues, especially when running under Wine on Linux. (CTRL + Z would permanently delete 10 lines of code, for some reason.)

The final project in that class is typically to create a disassembler written in 68k assembly, which is no small task. My group wanted to incorporate continuous integration in our project so that we could ensure that our code worked. However, this software had shortcomings that prevented us from doing so. (And how can we blame it, some of the original assembler source code is dated from 1986.)

We instead opted to create our own simulator, using Python. This gave us native cross platform support, and from it we were able to build a command-line application that could load assembly, assemble it, disassemble it, and simulate it.

For the scope of the final project, we only implemented about 6 opcodes, just enough for us to print out a “Hello World!”.

This project is occasionally updated. We originally had grand plans for making a full implementation to replace EASy68k, but are unsure of the ability to commit enough time to the project.

; Constants
CR  EQU     $0D
LF  EQU     $0A

start   ORG    $1000
        ; Output the prompt message
        LEA     MSG, A1 
        MOVE.B  #14, D0 
        TRAP    #15     
        ; halt
        MOVE.B  #9, D0
        TRAP    #15
MSG     DC.B    'This is some text', CR, LF, 0
        SIMHALT             ; halt simulator
END start