8
Simulators for Other Architectures
In this chapter, you will learn how to create simulators for different instruction set architectures, for example, the stack-based computer and the classic CISC.
After describing a simple stack-based calculator, TC0, we will introduce a simulator for a one-address format. Most operations take place between an accumulator (i.e., register) and the contents of a memory location; for example, ADD Y
means add the contents of memory location Y to the accumulator. The term accumulator indicates the location where the result of an addition is accumulated. Early microprocessors lacked room on the silicon chip for multiple registers, and all data had to pass through one or two accumulators.
After that, we will simulate a CISC architecture, which is an extension of the accumulator-based machine, where you can perform an operation on the contents of memory and on-chip registers.
Finally, we will present the code of TC4. This is a simulator for a...