Exercise · Volume 1 · 1.4.3.1-8
Exercise 1.4.3.1-8
not stated yet in Lean solution written
| Rating | 20 |
|---|---|
| Kind | K2, decide: say whether a claim holds from the written solution |
| Section | Section 1.4.3.1 of Volume 1. Companion chapter: A MIX simulator |
The task
True or false: whenever line 010 of the simulator is executed, .
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
How can rI6 get a new value? Look at the places where it is changed.
Hint 2
What happens after the instruction at the last location of the simulated memory, if it is not a jump?
Solution
Show the solution
False. The value rI6 is the location of the next simulated instruction. It is set by ENT6 0 at the start, increased by one at line 012, and set to by JSJ at line 255. The jump goes only to an that MEMORY has checked, so . The only way to get a value of rI6 outside the range is the increase by one. This can give , when the simulated program has no jump at location and goes on to the next location. Then line 010 loads the word at location BEGIN, which is the first instruction of the simulator, STZ TIME(0:2). The simulated instruction has an address that is not in the simulated memory, so the next step is a MEMERROR. The statement is true for the weaker form , because the value can not go higher: a MEMERROR stops the program before the next increase.
Check
I ran the simulator on a MIX simulator with the simulated program JMP 3499 at location 0. The location 3499 holds a NOP. After it, line 010 was executed with , and the run ended with the error exit MEMERROR (register A , the code of this error in the test). The location counter was 3501 after the increase.
Remarks
The simulator is protected against this case by the error exit and not by a test in line 010. A test in the control routine would cost time in every cycle.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.