Exercise · Volume 1 · 1.3.1-25
Exercise 1.3.1-25
not stated yet in Lean solution written
| Rating | 30 |
|---|---|
| Kind | Informal: the exercise has no formal statement, so Lean does not state it from the written solution |
| Section | Section 1.3.1 of Volume 1. Companion chapter: Description of MIX |
The task
Suggest improvements that an extended machine could offer while still running all MIX programs unchanged.
The exact wording is in your copy of the book.
Solution
Show the solution
A program is correct on the old machine only if it uses defined features. So the new machine may give a meaning to everything that MIX leaves undefined. Four kinds of undefined things exist, and each gives a place for an improvement.
First, the I-field takes the values to . The values from up to the byte size are free. They could stand for indirect addressing, for the use of the address of a second index register, or for index registers with an index of J. For example, with two index numbers could say that is the sum of the address and two registers.
Second, the address is limited to for memory references. The values above could make a larger memory possible, to words. For the index registers and rJ, a longer register of five bytes could be offered, with the old two-byte registers as a special case. Overflow of index registers is undefined, so an extension may do anything.
Third, the field and the operation code have unused combinations. The op has the fields , and to are free for new special operations such as bitwise and, or, exclusive or, and count of ones. The shift operator has the fields to , so other shifts, such as binary shifts or rotations of single words, could come. MOVE with does nothing now; a negative count could move backwards. The jump operator has the fields to , so jumps on an odd or even rA, and jumps on the sign of rX could come. An "execute" instruction, which performs the instruction in cell and goes on, would be one more variant of .
Fourth, the machine around the core. More and faster input-output units, a real-time clock in a special address, an interrupt system with negative addresses, and a protected mode for several programs. All of them leave the old programs unchanged, provided that the old programs do not use the addresses that are now special, and the old programs cannot do that because they are undefined.
A design is only good if it does not change the time of old instructions in a way that old programs notice, so a faster implementation is also an improvement. A new feature that changes the meaning of a defined word is not allowed.
Remarks
The extension idea is an instance of upward compatibility: the new machine runs the old programs and adds new ones. Compare Section 1.4.4 for interrupts.
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.