Using the Reference Decoder as a Shared Library
If you'd like to follow along with the homework using the reference decoder instead of your own, it is now much easier to do so.
Starting this week, we're going to be simulating some of the things that the 8086 does when it executes the instructions we’ve learned to decode. I really want everyone to do the homework for this section unless you happen to be fluent in assembly language already, because learning how instructions work is an important prerequisite to understanding everything that comes later in the course. But, the simulation homework does require that you can decode a few instructions, and that you can decode them into convenient-to-work-with data.
I realize that not everyone had time to make a decoder they are comfortable with. The point of the decoding homework was to make you familiar with what decoding was, not to teach you how to write a great decoder. So as long as you feel like you understand how decoding works, you’ve done all you needed to do for last section’s homework.
Given that, I was worried that people following along in Python or C# or some other non-C language would not have an easy way to use my reference decoder if they wanted to. C/C++ users can just cut and paste the code they need, or copy my codebase and start from there. But anyone following along in another language can’t do that.
Thankfully, over the past few days I realized that the reference decoder I posted could be easily made into a shared library callable from any language. So I went ahead and made the necessary changes, and have updated the github repository with the new code.