#19273 - alek - Thu Apr 15, 2004 8:42 pm
I'm trying to get the division algorithm from http://www.peter-teichmann.de/adiv1e.html to work in my project.
Here is the pice of the original code which I am having problems with:
I got a lot of errors so I changed it to this
I still get the following errors when I try to compile:
fixdiv.s:264: Error: invalid constant -- `ands r3,r1,#80000000'
fixdiv.s:273: Error: invalid constant -- `tst r3,#80000000'
fixdiv.s:275: Error: invalid constant -- `tst r3,#40000000'
what shoul I do
thanks,
I didn't know whether to put this post in the asm forum or the beginner forum but since this is not a complex problem I decided to put it here
Here is the pice of the original code which I am having problems with:
Code: |
|FDIVS| ands r3,r1,#&80000000 rsbmi r1,r1,#0 eor r3,r3,r0,asr#1 ;bit 31 = quotsign, bit 30 = remsign cmp r0,#0 rsbmi r0,r0,#0 mov r12,r14 bl |FDIV| tst r3,#&80000000 rsbne r0,r0,#0 tst r3,#&40000000 rsbne r1,r1,#0 movs pc,r12 |
I got a lot of errors so I changed it to this
Code: |
fixdivs: ands r3,r1,#80000000 rsbmi r1,r1,#0 eor r3,r3,r0,asr#1 @bit 31 = quotsign, bit 30 = remsign cmp r0,#0 rsbmi r0,r0,#0 mov r12,r14 bl fixdiv tst r3,#80000000 rsbne r0,r0,#0 tst r3,#40000000 rsbne r1,r1,#0 movs pc,r12 |
I still get the following errors when I try to compile:
fixdiv.s:264: Error: invalid constant -- `ands r3,r1,#80000000'
fixdiv.s:273: Error: invalid constant -- `tst r3,#80000000'
fixdiv.s:275: Error: invalid constant -- `tst r3,#40000000'
what shoul I do
thanks,
I didn't know whether to put this post in the asm forum or the beginner forum but since this is not a complex problem I decided to put it here