Our websites use cookies. By continuing, you agree to their use. See details
68K DISASSEMBLER | Portfolium
68K DISASSEMBLER
favorite 1
visibility 11,298
March 20, 2013 in Computer Science
1 / 6
A single pass 68K disassembler written in 68K assembly language for use with an emulator. This was the final project for my hardware and computer organization class at UWB. It ended up being one of the most satisfying things I've ever worked on!

To start, we were tasked with creating a program using the 68K instruction set that could analyze a specified region in memory and return any valid 68K instructions that were encountered. In order to run this program we used the Easy68K emulator because machines using the original Motorola 68000 processor are difficult to come by.

In order to accomplish this, we first wrote a looped program that would request specified memory addresses from the user and validate them. After that, we had the program check each memory address in the specified sequence 2 bytes at a time, place the bytes at that address into a 16 bit register, and jump to an OP-code analyzer subroutine to determine if the bytes formed a valid instruction or not. In order to determine the validity of the instructions, a series of jump tables were created to analyze the individual bits in each potential instruction in specific positions to narrow down the possibilities. Creating a 65536 line jump table for all 2^16 possible combinations would have been inefficient in terms of memory usage (and development time), so this indirect approach worked quite well.

Another consideration that had to be made was when the detected instruction indicated that an address was to be specified in the following bytes. This meant that the following data should not be checked as an instruction, so we needed to advance the address counter and jump to an effective addressing subroutine instead. There were many small gotchas like this throughout the development of the program, which proved to be rather interesting challenges. That's not to mention that we were only working with 8 registers, and were determined not to have to back any of them up to the stack in memory (more expensive clock-cycle-wise). In the end our program worked flawlessly, and we even threw in some ASCII art to please the professor. ;)

See attached PDF for source code!
© 2025 • All content within this project is strictly the property of Alexander Johnson and is not for public use without permission. Report Abuse
Alexander Johnson
Computer Science and Software Engineering at University of Washington
Alexander Johnson

2 Tags

1 Likers

Ebrima Ceesay