GOSUB will use just a little more space.
Example...
I am working a piece of code with two sub routines that when finished will be part of the main code, a flow through thing. I have them as GOSUBs now for testing, easily comment out a GOSUB to test one or the other.
As the code stands currently with the GOSUBs and RETURNs in place 3528 bytes are used.
When I remove the GOSUBs and RETURNs 3516 bytes are used.
The extra space is small compared to having a "function" written over and over.
The way to have the smallest code is this respect is to have one loop, but if you have an ADC that needs read more than once in the main loop a GOSUB/RETURN will be much smaller than having the ADC written twice... or more.





Bookmarks