Exercise 5.7
Chapter 5.2: Register-Machine Simulator