Learn · Volume 1
Section 1.4.3.1. A MIX simulator
8 exercises: 8 with a written solution, 0 stated in Lean, 0 proved in Lean.
1. Read first
The companion chapter builds on these. Read the ones you do not know yet.
- P1. Proof, induction and invariants
- C1, Section 1.3.1. Description of MIX draft
- C1, Section 1.3.2. The MIX assembly language draft
- C1, Section 1.4.1. Subroutines draft
- C1, Section 1.4.3. Interpretive routines draft
2. Read the section
Read Section 1.4.3.1 in your copy of the book. Then read the companion chapter A MIX simulator (a draft): it explains each item in the words of the handbook, with examples and proofs. The items of the section and their status.
3. Work the exercises
Section 1.4.3.1
The exercises of Section 1.4.3.1 are about the MIX simulator of the text, an interpretive routine written in MIX. Exercise 1 asks how to organize the subroutines better. Exercises 2, 3 and 6 write the operator routines that the text leaves out: the shifts, MOVE and the input-output operators. Exercise 7 changes the input-output routines so that the data move later. Exercise 4 adds the start by the GO button, exercise 5 measures the time of the simulation, and exercise 8 is a statement about the location counter.
For these solutions the simulator program of the text was typed in for testing on a MIX simulator that was written for this handbook, with the true instruction times. The routines of exercises 2, 3, 6 and 7 were run inside it and compared with the real instructions on the host. The listings in the solutions are new code. See also the C1 chapter on Section 1.4.3.1.
A good order is 8, 4, 1, 5, 2, 3, 6, 7.
From the Solutions volume of the handbook. The source.
The list starts with the lowest rating. Try each exercise on paper first. Its page has the hints one at a time, the solution behind a click, and the Lean status.
| Exercise | Rating | Kind | Solution | Lean |
|---|---|---|---|---|
| 1.4.3.1-1 | 14 | informal | written | not stated yet |
| 1.4.3.1-4 | 14 | K6 | written | not stated yet |
| 1.4.3.1-2 | 20 | K6 | written | not stated yet |
| 1.4.3.1-8 | 20 | K2 | written | not stated yet |
| 1.4.3.1-3 | 22 | K6 | written | not stated yet |
| 1.4.3.1-5 | 24 | K3 | written | not stated yet |
| 1.4.3.1-6 | 28 | K6 | written | not stated yet |
| 1.4.3.1-7 | 32 | K6 | written | not stated yet |
Something is wrong? Report it.