Please help me remember how to do simple SPIN math
Alex.Stanfield
Posts: 198
I'm trying in SPIN to set a future check point in time and continue doing other stuff under the same cog (i.e.: nxtchk := cnt + delay_in_clks)
I need to check when cnt crosses nxtchk, precision timming is not an issue, I just have to capture it the next time the loop passes where the check is and cnt has crossed nxtchk.
Trouble comes when crossing the boundaries of 32bit signed integers, like when cnt is below $7FFF_FFFF and nxtchk goes above $8000_0000, or cnt below $0 and nxtchk above $0
This code will not do:
Can someone remind me how to do this simple check?
Thanks
Alex
I need to check when cnt crosses nxtchk, precision timming is not an issue, I just have to capture it the next time the loop passes where the check is and cnt has crossed nxtchk.
Trouble comes when crossing the boundaries of 32bit signed integers, like when cnt is below $7FFF_FFFF and nxtchk goes above $8000_0000, or cnt below $0 and nxtchk above $0
This code will not do:
if cnt > nxtchk '' then do some stuff
Can someone remind me how to do this simple check?
Thanks
Alex
Comments
-Phil
Yes, of course that was it!
Thanks again Phipi!