taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.3.1-12

Exercise 1.3.1-12

not stated yet in Lean solution written

Rating10
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.3.1 of Volume 1. Companion chapter: Description of MIX

The task

Find one instruction that doubles rI3.

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

The instruction INC3 adds the address MM, and MM is the address plus the contents of the index register.

Solution

Show the solution

INC3 0,3. The address is 00 and the index is 33, so M=0+rI3M = 0 + \text{rI3}. The instruction adds MM to rI3. So the new rI3 is 2 rI32\,\text{rI3}, if this value fits in two bytes.

Check

python3: for the values −7,0,5,1000-7, 0, 5, 1000 of rI3 the sums rI3 + rI3 are −14,0,10,2000-14, 0, 10, 2000.

Remarks

The same trick INCA 0,1 adds rI1 to rA.

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.