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 15:05
Read: times


 
#81514 - efficient C
Responding to: ???'s previous message
It seems to be very efficient assembly code and is exactly the same as what I had written manually. You guys are absolutely right there seems to be no advantage of using assembly for this application.

I have found that if the code is "plain" there, usually, is no big advantage to recoding in assembly. The main advantages are gained where you "know something the compiler can not know"

Where the gain using assembly can really be seen is if you do things like moving between multiple XDATA areas that all are 'page bound' using a processor with a mov @Ri high address SFR. The C compiler does not 'know' that your "XDATA areas" are 'page bound' and thus will test for byte overflow on each increment. Do note that, doing such, you need HEAVY COMMENTING so the poor sod (most likely yourself) that increase the areas or "see no reason for the page boundary" will not get caught.

Erik


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