4
Crafting an Interpreter – First Steps
In this chapter, we’ll take our first steps toward constructing a computer simulator by constructing a very primitive simulator that can execute only a single instruction. Once we’ve taken this step, we can move on by gradually enhancing this simulator.
The key topics that we’ll cover in this chapter are as follows:
- Designing a minimal computer with one instruction
- Designing a simple simulator that can decode and execute several instructions
- The instruction set of a general-purpose computer called TC1
- Handing bits in Python (Boolean operations)
- Decoding an instruction in binary form into its component parts
- Executing an instruction after it has been decoded
- Arithmetic operations in a computer
- Designing functions in Python
- Branch and flow control instructions in computer instruction sets
Collectively, these topics cover three areas. Some topics expand our knowledge...