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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/20/05 17:33
Read: times


 
#92005 - Yes, you can
Responding to: ???'s previous message
Raghunathancan said:
can we say " No. You cannot call a C function from an asm code " ?

No, that would be incorrect.

Of course you can call a 'C' function from assembler - you can do anything in assembler.

The question is, why on earth would you want to do it?!?!

As Neil says, if you have a 'C' function in your project, you will also need all the 'C' "baggage" to support it - unless it's a trivial function, in which case why use 'C' anyway?!
And if you have to have all the 'C' "baggage" anyhow, what's the point of writing the rest of the code in assembler?!

Hence we end up with the "normal" approach of having most of the code in 'C', and just calling assembler function for the bits where 'C' doesn't cut it.

List of 18 messages in thread
TopicAuthorDate
Calling a C function in a 8051            01/01/70 00:00      
   It depends....            01/01/70 00:00      
      You may not want to do it anyway            01/01/70 00:00      
         C from ASM : Yes or No            01/01/70 00:00      
            Yes, you can            01/01/70 00:00      
               Why on earth?            01/01/70 00:00      
            C called by assembly called by C            01/01/70 00:00      
   What compiler            01/01/70 00:00      
      RE: What complier            01/01/70 00:00      
         I do not know            01/01/70 00:00      
         RTFM!            01/01/70 00:00      
            oh well            01/01/70 00:00      
   SDCC can do it            01/01/70 00:00      
      any compiler can do it!            01/01/70 00:00      
         the answer is not to that question, I th            01/01/70 00:00      
            I don't think. I done it            01/01/70 00:00      
            VFM?            01/01/70 00:00      
               that is my impression            01/01/70 00:00      

Back to Subject List