Can someone explain to me how division in MIX (from TAOCP by Knuth) works on a byte-to-byte basis?
rA = |-| . . . .0|
rX = |+|1235|0|3|1|
The memory location 1000 contains |-|0|0|0|2|0|
.
When you execute the operation
DIV 1000
the registers become
rA = |+|0|617|?|?|
rX = |-|0|0|0|?|1|
Now I understand the signs on rA
and rX
, but in what order are the bytes of rAX
filled and which divisions are done?
If DIV 1000 leads to every bit divided by 2, then I would expect
rAX = |+|617|0|1|0|-|0|1|0|1|1|
in which rA
contains the division results and rX
the remainders (filled from the right side).
I'm probaly missing something here, and Knuth seems to think I should be able to figure it out myself (hence the level 10 questions about it, which I also don't get), but could someone help me out here?