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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/19/04 13:19
Read: times


 
#81504 - ASM vs 'C'
Responding to: ???'s previous message
I am planning to write one of my ISR in Assembly because they are very much time consuming with C ... with C code it was taking approx 180 Machine cycles I thinks with assembly I will be able to reduce this time required.

Oh no, not that old chestnut again!

To simply say, "C code was taking approx 180 Machine cycles" is meaningless without knowing what you were actually trying to do in your ISR.

You should review your 'C' code first!
Any "inefficiency" is far more likely due to poor use of 'C' for the 8051 rather than any inherent inefficiency in the compiler.
eg, if you do everything in signed ints, then you will get "inefficient" code...!

Search here & on the Keil site for previous discussions on ways to write optimum 'C' for the 8051.
There is a whole chapter about it at the back of the Keil C51 Manual


List of 13 messages in thread
TopicAuthorDate
Interrupt Function Prototype & Keil            01/01/70 00:00      
   Re: Interrupt Function Prototype & Keil            01/01/70 00:00      
      No Parameters            01/01/70 00:00      
         ASM vs 'C'            01/01/70 00:00      
         Interrupt Routines            01/01/70 00:00      
            Assembly code no better than keil            01/01/70 00:00      
               efficient C            01/01/70 00:00      
         Hardware IIC            01/01/70 00:00      
         I2C(C) = I2C(asm)            01/01/70 00:00      
            C-asm delay            01/01/70 00:00      
               OSC_FREQ            01/01/70 00:00      
      no need for prototypes!            01/01/70 00:00      
         Same            01/01/70 00:00      

Back to Subject List