Dwight Elvey
Veteran Member
Got it mostly figured out. P1 (R2,R3) points to the dividend. P3 (R6,R7) points to the divisor. P4 (R8,R9) points to the quotient.
I don't know what P2 (R4,R5) points to, but it's not the remainder. for example, when I divide 9999999 by 2, the register that P2 points to contains all zeros. When I divide 1000 by 3, the register that P2 points to contains 1000. When I divide 22 by 7, the register that P2 points to contains 600000. ???
The quotient is a 16 digit number with the decimal point in the middle. For example, dividing 9999999 by 2 gives 4999999500000000 which is 4999999.500000000
More about P2:
When 1000000 is divided by 3, P2 points to 1
When 100000 is divided by 3, P2 points to 10
When 10000 is divided by 3, P2 points to 100
When 1000 is divided by 3, P2 points to 1000
When 100 is divided by 3, P2 points to 10000
When 10 is divided by 3, P2 points to 100000
When 1 is divided by 3, P2 points to 1000000
I did some more experimenting. First, the quotient has it decimal point at half way. The divisor looks to be first divided by 10. The R register has the dividend pushed to the bottom end of the number if the result overflows, other wise it is 0.
So, reading high memory to low( which is how number are stored ) the dividend number 0000000460000000 is 4.6. The divisor 0000000200000000 looks like 2.0 but is really 0.2 the quotient will be 0000003200000000 or 32.0 ( note the 10* because the divisor is really 0.2 ). Underflows are just truncated.
Note, as I said the decimal point is assumed to be in the center. This is mainly important for divide!
Dwight