> but without local variables, you have to keep track of every variable that every little subrouting uses...
I'm sure I've used @ beyond the first column... but @ has to be the first character encountered on the line. How far along the line PBP finds it, is I think not relevant. To be fair, I've not tried it with MPASM, but certainly with PM several Tab-Stops still finds it working.
The luxury of 'Local Variables' was extended to you first in Compilers or Interpreters that have access to near limitless resources. It's almost impossible to run out of RAM in a Visual Basic program for example - if you are the most wasteful shoddy programmer on the planet, how much RAM can you use? 100kb out of some 256Mb (or more) avaiable to you? This is not the case with most PICs, and certainly not the case with the 12F or 10F series! A couple of dozen variables and suddenly you're in deep trouble. So variables HAVE to be reused. So document your subroutines - it'll only take a minute. Indicate in a comment header at the start, what the entry variables should be, what the exit variables are, and the names of any working variables or other subroutines used internally. You only need to add this documentation once, and it's there for life. You can pick-up that subroutine in six months time and you KNOW where you stand.
> must the compiler write a "sleep" line or wake up our friend from his dreams ???
Hey, I always write my best code when I'm asleep. It's remembering what I wrote next morning that's the problem...
Bookmarks