??? 05/21/07 14:36 Modified: 05/21/07 14:39 Read: times |
#139588 - Just one more byte ... Responding to: ???'s previous message |
Jan said:
But as I said above, I see code memory the least pricey resource in today's '51, so if I would try to optimize it would be (I)RAM or execution time optimisation rather than code length. I agree. However, in this case execution speed isn't important at all because the routine is waiting for a human most of the time. And, the only way to conserve RAM is to inline the function calls to avoid using stack space -- not very interesting. However, in this kind of stuff, I would rather seek additional functionality than optimising. Again, I agree. I was doing it mostly as an exercise. I once took a class where the homework programs were graded based on how small you could make them. Although that is a very stupid way to teach programming, it was a lot of fun, even though I never had the smallest program in the class. Based on that, I'm actually surprised that nobody has found a way to shave another byte or two out of the line editor program. Probably it's because Jan's original program was so well optimized to begin with! -- Russ |