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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/15/03 07:30
Read: times


 
#60603 - RE: Call C Func. from Asm program?
Responding to: ???'s previous message
I'm trying to interface a DAC to my 8052 to create a sine wave. I know there is a function in C (sin())...

That will necessitate including the whole 'C' floating point support in your program, and coping with the floating-point result in your assembler.
It would probably be much easier just to use a lookup table in assembler.
Michael Karas recently presented an easy way to generate lookup tables using Excel - do a 'Search'

I have seen that there is a way to have an assembly language program call a C function from another file, but they omitted a good example.


You will need to read the section(s) on internal data representation and calling convention in the compiler manual.

The Keil C51 manual has a section specifically titled "Interfacing 'C' and assembler"

To see an example, why not just look at the assembler generated by the compiler itself!?

List of 6 messages in thread
TopicAuthorDate
Call C Func. from Asm program?            01/01/70 00:00      
   RE: Call C Func. from Asm program?            01/01/70 00:00      
   Sledgehammer to crack nut?            01/01/70 00:00      
   RE: Call C Func. from Asm program?            01/01/70 00:00      
      RE: Excel            01/01/70 00:00      
   RE: 8-Bit Sin Lookup Table !!            01/01/70 00:00      

Back to Subject List