PDA

View Full Version : Code optomization ideas...(link)



Heckler
- 17th February 2012, 14:21
I ran across this...

looks like some good ideas to save a few bytes if your tight on code space or exectuion time...


(http://www.rcfaq.com/PIC/optimize.htm#var-increment)http://www.rcfaq.com/PIC/optimize.htm

Art
- 17th February 2012, 15:29
I posted that link in a thread recently, and Darrel advised against listening to any of it :D
I trust that he knows this language better than I do, so I didn't look into it further.

A few years back some (since removed) optimisations on that page used to work,
but it appears some work has gone into PBP since then.

pedja089
- 17th February 2012, 15:32
That is nice way to get headache.You shouldn't use ASM instruction like it described on link. Because you must check bank, before use variable...

Art
- 17th February 2012, 15:34
Looking at it again, there is accessing variables from asm which will cause problems if the code is larger than a page,

Some of the other stuff causes you to misrepresent in code, what you are actually writing, and if it does still work,
you'll need a good memory when you're later trying to understand what you were doing.

Heckler
- 17th February 2012, 16:07
Theres an old addage that I learned years ago while studying analog microwave communications testing...

1) pull your head out
2) know what to expect
3) question your results
4) refer back to #1

If I were to take a stab at adapting it to information on the internet...

1) don't forget you got it from the internet
2) know something about which you are studying
3) question every thing you read on the internet
4) refer back to #1

(mabie someone else can improve on the above)

I had not noticed your posting of the same link earlier, Art.
Thanks for correcting me
I definately value Darrels opinion.