Cliff McCain

MC9S12GC32 Assembly Code Division

Discussion created by Cliff McCain on Apr 16, 2010
Latest reply on Apr 16, 2010 by kef

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?