Quote Originally Posted by Asmith View Post
Ioannis:
I believe PBP will do negative numbers, Location should never be a negative number anyways as 0 would be the lowest number of counts you can have it will be zero we it is set up.
Sure, PBP and assembly both will do negative numbers, but they won't show up the way you want them to...i.e.:

5 - 6 = -1, but PBP will show 255 (for a byte variable), 65535 (for a word variable).

You're going to want to add something like this to your program in post #4:

main:
IF Pulse = 1 AND Was_Low = 0 THEN
IF Direction = 1 THEN
Mult_Count = Mult_Count + 1
ELSE
if mult_count > 0 then mult_count = mult_count - 1
ENDIF
Was_Low = 1
ENDIF
...............

IF Mult_Count = -10 THEN(statement won't work the way you want it to in PBP)
Location = Location - 1
Mult_Count = 0
ENDIF