I'm working on an assembly project where I need to do division and make use of the remainder when the remainder is less than 1. For example 5113/5 which "on paper" equal 1022.6. However the result of this division inside the micro is Y=3FE (1022) and D=3 (which represents .6) I'm aware that the fractional portion of a quotient is stored as a binary weighted value but I' trying to understand how I can manipulate the 3, in this case, in such a way that it gets stored as an integer 6 so that I can ultimately effectively multiply the result of 1022.6 by 10 to get 10226. Anyone have any ideas?

Thanks,

uCRFun

Something is not right here. 5113/5 should return 0x9999 for binary remainder, not 3. The meaning of 0x9999 is that 0x9999 / (2^16) gives about 0.6.

To convert 0x9999 into 6 you should multiply 0x9999 by decimal 10 and divide by 2^16. 0x9999 * 10 = 0x5FFFA. In this case you will get 5, not 6. It's becouse of rounding. 0xFFFA (0.9999) is very close to 2^16 (1.0). To round you can add 0x8000 (0.5) to product before dividing it by 0x10000.