Quote Originally Posted by aratti View Post
Put yours subrouteenes at the end of your code, never at the beginning!
Disagree 100%, ok maybe 99%
If using a PIC16 (or 12,or 10) series PIC, if you are able to keep the 'subroutines' in the first bank of code space, you'll save code space due to the fact that the BANK Select registers don't need to be changed, and at the same time save instruction cycles. And if your subroutines are at the beginning, they're the first thing to get seen while skimming thru the code, makes them harder to forget them (I guess more of a brain thing there).

At any rate, there's one more small bug in your If/Then correction above (post #13)...a small one...actually two small bugs...one matters, the other doesn't really matter...