Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/19/07 06:47
Read: times


 
#135244 - Optimise & kill code
Responding to: ???'s previous message
When I started using the IAR 8051 compiler, I'd crank up the optimisation and my code would stop! So I'd just turn the optimisation off. Over the years I've become a lot wiser especially with the use of the 'volatile' keyword and now I can turn up the optimisation and my code still works. Whilst the code size for most of my apps isn't an issue (as long as it fits in the flash!) I noted when I got the latest version of the IAR compiler than on full optimisation the code shrank by half. Whilst still not quite as good as assembler (the original app was in assembler as the cpu I used only had 8k flash, when the new cpu came out, it had 62k flash, so I rewrote the code in 'c') the assembler app was around 6K, the 'c' version weighs in around 9k with full optimisation.

List of 19 messages in thread
TopicAuthorDate
akkkk! stupid compilers, something to watch            01/01/70 00:00      
   ehm, isn't it the user?            01/01/70 00:00      
      Well it might be phooey;- but its pretty common            01/01/70 00:00      
         have you considered using a timer, perhaps... :-)            01/01/70 00:00      
            yep but...            01/01/70 00:00      
               Sorry - not this time, Jez            01/01/70 00:00      
               if it is THAT short...            01/01/70 00:00      
                  Maybe not...            01/01/70 00:00      
                  Beware.            01/01/70 00:00      
   Well, any compiler with half a brain does that.            01/01/70 00:00      
      volatile            01/01/70 00:00      
   use util/delay.h and read the lib documents            01/01/70 00:00      
   optimization = lost control            01/01/70 00:00      
   well that is the first mistake            01/01/70 00:00      
      First mistake is using a HLL            01/01/70 00:00      
   Optimise & kill code            01/01/70 00:00      
      optimizers and NASA            01/01/70 00:00      
   There are many levels in Keil            01/01/70 00:00      
      not always a good idea            01/01/70 00:00      

Back to Subject List