Say you want to increment a variable and check the upper limit.
One way is this:
which compiles for a 16F877 to 16 bytes.Code:if index<3 then index=index+1 else index=0 endif
Using this one:
compiles to 12 bytes.Code:index=index+1 & 3
And even better:
compiles to 7 bytes only!Code:index=index+1 index=index & 3
Ioannis
P.S. Thanks to Mike K8LH for spotting a typo error.
Bookmarks