Hello all,
Long time - no post. Hope everyone is well.
Here goes my dumb question:
Word1 VAR WORD
Word2 VAR WORD
Word1 = 1000000/Word2
Can I do that, or is there a method I may be missing?
Thanks all,
Chris
Hello all,
Long time - no post. Hope everyone is well.
Here goes my dumb question:
Word1 VAR WORD
Word2 VAR WORD
Word1 = 1000000/Word2
Can I do that, or is there a method I may be missing?
Thanks all,
Chris
Tray this should work:
Word1= 1000*1000
Word1= Div32 Word2
Word2 cannot be larger then 32768 (2^15)
Cheers
Al.
All progress began with an idea
I don't think so. What if Word2 = 1 your result would be 1000000 which is well beyond 65535 a WORD variable can handle. You'd have to use a PBP LONG and a 18F chip I think.
Someone else already posted a viable solution.
Thanks guys,
Aratti's math appears like it will do the trick.
Thanks again,
Chris
In such a case you con intercept the condition with an "IF / THEN" instruction, so that you can handle the error.I don't think so. What if Word2 = 1 your result would be 1000000 which is well beyond 65535 a WORD variable can handle. You'd have to use a PBP LONG and a 18F chip I think.
For instante: If Word2 is less than 16 goto skip. And handle the math in a different way.
Cheers
Al.
Last edited by aratti; - 25th July 2013 at 07:49.
All progress began with an idea
Bookmarks