Shop OBEX P1 Docs P2 Docs Learn Events
Please help me remember how to do simple SPIN math — Parallax Forums

Please help me remember how to do simple SPIN math

Alex.StanfieldAlex.Stanfield Posts: 198
edited 2012-05-12 11:43 in Propeller 1
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:
  if cnt > nxtchk
    '' then do some stuff

Can someone remind me how to do this simple check?

Thanks
Alex

Comments

Sign In or Register to comment.