Reference no: EM134570
The authors of the book do a very thorough job explaining Simpleton's operation, and encourage you to take a look at what they have written before you read any further.
For the most part, your objective in this assignment is the same as what is listed in the book with the following exceptions:
1. For this assignment, it is okay to ignore the sign of the instruction.
2. The interactive console's operation has been altered from what is listed in the book. After receiving a complete program from the user, you will iterate over each instruction.
Prior to executing a given instruction, you must do a memory dump. In other words, display the accumulator, the current instruction, and the values in each memory location (see screenshots).
3. Section occurs before the authors introduce C++. Because we have moved onto C++, your solution must be written in C++, contain one or more classes, and use data structures when appropriate. At minimum, your program must contain a "Simpletron" class that will be used to represent the state of the Simpletron machine.
Sample Implementation
Implementation contains a Simpletron class and several supporting Instruction classes (one for each instruction supported by the Simpletron).
Instruction to represent an instruction supported by Simpletron. As such, create a child class for each instruction (approximately 13 sub classes) and a factory to handle new object creation. Also note that create an enum called Operation_t that acts as an easier way to work with operations (i.e. using Read, Write, Load, etc. instead of 10, 11, etc.). Other than that, it's mostly getters and setters with the exception of the virtual execute method.