HW 2: Instruction Encoding & Simulators

CS 441 Homework, Dr. Lawlor

For this homework problem, I'd like you to design your own instruction encoding that supports:
Feel free to use a CISC or RISC encoding, 2 or 3 operand instructions, ASCII or binary format--your choice!

To test out your instruction encoding, write a simulator to run programs written with your encoding on a normal machine.  A simulator usually is just a fetch-and-execute loop, where you grab the next instruction from the program (fetch), look at what it says to do (decode), and then do it (execute).  For reference, here's my little "UEMU" simulator (but you can't do exactly what I did!).

This homework will be due at midnight on Thursday, September 17 on Blackboard.  My preferred format is a single runnable source code file, with your instruction set's human readable design in a comment at the top, the simulator code included right there, and a main function and well-commented sample program hardcoded in.