What you basially have is a division with a 24bit result. So it's a 24bit division, or more precisely you multiply A by 256 (increase A from 16bits to 24bits) then you do a 24bit / 8bit division with a 24bit result....
Range of values:
C: b 0000 0000 0000 0000.0000 0001 - b 1111 1111 1111 1111.1111 1111 (note binary point)
A: b 0000 0000 0000 0001 - b 1111 1111 1111 1111
B: b 0000 0001 - b 1111 1111
...
To again use the successive subtraction analogy you would do this;
Rich (BB code):
//(psuedo code);
C = 0
A = (A * 256) // scales A from 16bit up to 24bit
while(A >= B) // 24bit / 8bit division by successive subtraction
{
A = (A - B)
C = (C + 1)
}
xxxxxxxx xxxxxxxx . xxxxxxxx