See attached rabble of ASM snippets...lines 7-39. Also lines 398-449.
Sorry about the thread links embedded in the comments, they're from the old forum. You'll have to use Phil's thread converter to see the original threads.
I dunno why there isn't a nice sticky somewhere that compiles a bunch of useful ASM snippets in one place...
IIRC the spin interpreter is signed mult and divide. You can find the original code of the interpreter posted by Chip. There is a faster version in my spin interpreter (IIRC Chip provided the mult improvement - its noted in the code anyway).
To find may faster spin interpreter, follow the Tools link in my signature.
Thanks guys, I've not had a chance to follow up the leads but it looks really promising, I'll get back to you when I can, typically I have lots of paper work to do instead of coding
Comments
http://propeller.wikispaces.com/MATH
Massimo
mov __temp1,__param2 ' __param1 = __param2 * __param3 mov __temp2,__param3 abs __temp1,__temp1 WC muxc __temp3,#1 abs __temp2,__temp2 WC, WZ IF_C xor __temp3,#1 mov __temp4,#0 mov __temp5,#32 shr __temp1,#1 WC __L0001 IF_C add __temp4,__temp2 WC rcr __temp4,#1 WC rcr __temp1,#1 WC djnz __temp5,#__L0001 test __temp3,#1 WZ IF_NZ neg __temp4,__temp4 IF_NZ neg __temp1,__temp1 WZ IF_NZ sub __temp4,#1 mov __param1,__temp1 mov __temp1,__param2 ' __param1 = __param2 / __param3 mov __temp2,__param3 mov __temp4,#0 abs __temp1,__temp1 WC muxc __temp5,#1 abs __temp2,__temp2 WC, WZ IF_Z mov __temp1,#0 IF_Z jmp #__L0002 IF_C xor __temp5,#1 mov __temp3,#0 min __temp2,#1 __L0003 add __temp3,#1 shl __temp2,#1 WC IF_NC jmp #__L0003 rcr __temp2,#1 __L0004 cmpsub __temp1,__temp2 WC rcl __temp4,#1 shr __temp2,#1 djnz __temp3,#__L0004 test __temp5,#1 WZ IF_NZ neg __temp4,__temp4 IF_NZ neg __temp1,__temp1 __L0002 mov __param1,__temp4
Sorry about the thread links embedded in the comments, they're from the old forum. You'll have to use Phil's thread converter to see the original threads.
I dunno why there isn't a nice sticky somewhere that compiles a bunch of useful ASM snippets in one place...
To find may faster spin interpreter, follow the Tools link in my signature.
Graham