|
|
You can do a fixed point divide without using anymore iterations, because the result still has the same # of bits.
This divides two numbers in 16.16 fixed point,although there may be bugs in it. Also it's an unsigned division.
|fixdivu| PROC
sub r3,r3,r3
rsb r1,r1,#0
mov r3,r0,lsr #16
mov r0,r0,lsl #16
adds r0,r0,r0
; repeat 32 times
adcs r3,r1,r3,lsl #1
subcc r3,r3,r1
adcs r0,r0,r0
mov pc, lr
|
|