This repo contains the code for a Motorola 68000 processor emulator library.
The 68000Emulator solution consists of the following projects:
- 68000EmulatorConsoleTestApp: A simple console application that demonstrates the functionality of the library.
- 68000EmulatorLib: The code for the library itself.
- 68000Emulator.Tests: An extensive set of tests.
For the very same reason that I wrote emulators for the Z80 and 6502 processors... to relive a little of my youth, but mainly "just for fun" :-)
This project completes emulation of the trio of processors that I wrote code for in the 1980's and early 90's.
The included 68000EmulatorConsoleTestApp project demonstrates how to use the emulator. This application has a simple 68000 code example that it runs through the emulator.
From a developer's point of view, the emulator is used as follows:
- Create an instance of the
Machineclass, optionally supplying the size of memory to be allocated for the emulator (in bytes) - if no size is specified then the default 16MB of memory is allocated (which is the maximum that a real 68000 processor can address). - Load binary executable data into the machine by calling the
LoadExecutableDatamethod, supplying a word array (or byte array) containing the binary data and the address at which the data should be loaded in memory. - Load any other binary data into the machine [if required] by calling the
LoadDatamethod, supplying a word array (or byte array) containing the binary data and the address at which the data should be loaded in memory. The final parameter passed toLoadDatashould befalseto avoid clearing all memory before loading the data (otherwise any previously loaded executable data will be lost). - Set the initial state of the machine (e.g. register values, flags, etc.) [if required] by calling the
SetCPUStatemethod. - Call the
Executemethod to execute the loaded 68000 code. - Once execution has completed, the
GetCPUStatemethod can be called to retrieve the final state of the machine (register values, flags, etc.). - The
Dumpmethod can be called to get a string detailing the final state of the machine (which can be useful for debugging purposes).
The following are features that are being considered for the future:
- Implement a disassembler.
- Implement an assembler (because it's very tedious entering assembly language code in binary format).
- Implement some form of interactive debugger (with features such as single stepping, breakpoint handling, etc.).
| Version | Details |
|---|---|
| 1.0.0 | Initial implementation of the 68000 emulator. |