#17041 - corranga - Sun Feb 29, 2004 12:55 pm
I'm working on 20 12 fixed point multiplication now (after discovering my current routine was only working out the whole number part and no fraction!
I used to use the routine below when I dabbled a little into mips asm for the sony playstation:
//multiply the numbers together
mult a0, a1
//store the low part in v0
mflo v0
//and the high in v1
mfhi v1
// shift the high part into place
srl t0,v0,12
// and the low part
sll t1,v1,20
// or them together for the answer
or v0,t0,t1
is it possible to do something similar on the gba?
Essentially i'm asking how to do, 32bit * 32bit = 64bit (in 2 32 bit registers) if it is possible
If it can't be done, can someone point me in the direction of a fixed point 20 12 routine that I can modify / use. I'm going bald having worked on this for about 3 weeks!
Chris
_________________
If virtual reality is ever on a par with reality, I want to be Bomberman! :D
I used to use the routine below when I dabbled a little into mips asm for the sony playstation:
//multiply the numbers together
mult a0, a1
//store the low part in v0
mflo v0
//and the high in v1
mfhi v1
// shift the high part into place
srl t0,v0,12
// and the low part
sll t1,v1,20
// or them together for the answer
or v0,t0,t1
is it possible to do something similar on the gba?
Essentially i'm asking how to do, 32bit * 32bit = 64bit (in 2 32 bit registers) if it is possible
If it can't be done, can someone point me in the direction of a fixed point 20 12 routine that I can modify / use. I'm going bald having worked on this for about 3 weeks!
Chris
_________________
If virtual reality is ever on a par with reality, I want to be Bomberman! :D