Huh? Not really sure what you are talking about. Can you elaborate a little more please? Thanks.
Huh? Not really sure what you are talking about. Can you elaborate a little more please? Thanks.
I think what Alain means is when you go from 0 to 255, it simply adds 1 to the present number. When it reaches 255 it doesn't do any resetting. It simply adds 1 to 255 and it goes back to 0 itself. On 0 to 150 it has to constantly monitor the number and reset to 0 after 150. This uses more memory. I just learned a lesson from your post myself.
Comparing the generated Assembler code might give more clues.
Robert
Yes the generated assembler would be smaller.
An example of two BASIC IF...THEN comparisons in assembler
You are always testing for zero, helps if the comparison is zero!Code:@ movf _Variable ,W 'IF Variable = $A0 THEN... @ sublw 0xA0 'subtract comparison @ btfss status ,Z 'test if result is zero // condition is here @ movf _Variable ,W 'IF Variable = $00 THEN... @ btfss status ,Z 'test if result is zero // condition is here
Bookmarks