Signed multiply in PASM - need one
Chris_D
Posts: 305
Hi Follks
Somehow I painted myself into a corner with the PASM multiply example which is published in the new Prop manual.· I even asked for help on how to use it and was warned about it working with 16 bit values and postive numbers only.· Yet, I went ahead and used my selective reading skills to think it could work with signed numbers.
Now I am stuck and am hoping someone has a PASM multiply routine that can handle signed numbers.
I recall many months ago what I think was one posted by someone and I can't find it again.· I seem to recall the poster's avatar looking like an open cockpit pilot with bugs in his teeth - maybe goes by the name of Cessna pilot.· Even if you can't recall that one in particular, I am not that picky :-)· I just need one that can handle signed values.
Chris
Somehow I painted myself into a corner with the PASM multiply example which is published in the new Prop manual.· I even asked for help on how to use it and was warned about it working with 16 bit values and postive numbers only.· Yet, I went ahead and used my selective reading skills to think it could work with signed numbers.
Now I am stuck and am hoping someone has a PASM multiply routine that can handle signed numbers.
I recall many months ago what I think was one posted by someone and I can't find it again.· I seem to recall the poster's avatar looking like an open cockpit pilot with bugs in his teeth - maybe goes by the name of Cessna pilot.· Even if you can't recall that one in particular, I am not that picky :-)· I just need one that can handle signed values.
Chris
Comments
Chris
This is a signed 32-bit by 32-bit with a 64-bit result.
__temp1 is the lower 32-bits of the result
__temp4 is the upper 32-bits of the result
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
Post Edited (Bean) : 4/11/2010 2:38:40 PM GMT
Thank you VERY MUCH!· I will give that a go and see if I can get it working for me.
Chris
Any chance of there being an equivalent divide routine?
Thanks,
Parsko
The remainder is in __temp1 after the routine.
You can strip a lot of code if your values are always positive.
Bean