#16436 - corranga - Mon Feb 16, 2004 2:05 pm
Ok, i've written some asm to do fixed point division, but whgen I got to the last line, I thought hang on, how does the asm retuurn a value?
The code is as follows:
fixedDivASM:
mov r3, r1
swi 0x60000
@answer is in r0
mov r12, r0, lsl #12
@remainder is in r1
mov r0, r1
mov r1, r3, lsl #12
swi 0x60000
orr r0, r1, r12
Providing the code works properly (I thnik it should) I end up with the answer in r0. How do I either:
Return r0
OR
Return the answer in another way?
Chris
_________________
If virtual reality is ever on a par with reality, I want to be Bomberman! :D
The code is as follows:
fixedDivASM:
mov r3, r1
swi 0x60000
@answer is in r0
mov r12, r0, lsl #12
@remainder is in r1
mov r0, r1
mov r1, r3, lsl #12
swi 0x60000
orr r0, r1, r12
Providing the code works properly (I thnik it should) I end up with the answer in r0. How do I either:
Return r0
OR
Return the answer in another way?
Chris
_________________
If virtual reality is ever on a par with reality, I want to be Bomberman! :D