This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

calling C from Assembly

I am trying to learn to call some C floating point routines from Assembly.
I am quite proficient in writing Assembly programs which | have done commercially for many years.
I have read the <http://www.keil.com/support/docs/697.htm> page but can make no sense of it
Basically where is what to be done?
For example what does "You can then use the src file as a template to...."
And "....you must also include the EXTRN directive for the function, eg: EXTRN CODE (_foo)"
I include it where? Will the final project be an assembly project or a C project?
I have written my own Assy routines for +-x/ in Floating point but now need some Sin/Cos/log functions. Hence the need for C. Which I hate.
I found that it is not possible to use the #pragma src is directed and I have to assemble the file twice.
Can some kind person please help by, say, pointing to some page where I can begin to understand Keil C language conventions. The Keil Documents do not give a place where I can find the start of a thread to unravel. Every explanation points to another explanation in another place. I do know C/C++ but not segment controls much.
Thanks for the help

Parents
  • Hi!

    Thanks! I am aware of the Cordic (AKA Volders rtn) method and as I stated above have used it with CPLD devices to implement eg., some mass flow calculations in a batch metering system etc. I wrote code for the HW with VHDL. Sorry that I referred to the technique as Folders method ISO Volders which is pronounced Folders.

    There is this strange gap that I want to close. I do everything in Assy, of which too I don't fully know the conventions. All I am good with is writing complex routines in assy, which I am able to, being a hardware man at heart. It is high time I learned proper C and Assy.

    I feel like a fool when I visit various fora and cannot follow what is being discussed.

    I have found this book on the internet and will have it printed. It might just be the trick.
    ( printed vs read from a screen )

    The C Book1
    Mike Banahan, Declan Brady, Mark Doran
    January 1991

Reply
  • Hi!

    Thanks! I am aware of the Cordic (AKA Volders rtn) method and as I stated above have used it with CPLD devices to implement eg., some mass flow calculations in a batch metering system etc. I wrote code for the HW with VHDL. Sorry that I referred to the technique as Folders method ISO Volders which is pronounced Folders.

    There is this strange gap that I want to close. I do everything in Assy, of which too I don't fully know the conventions. All I am good with is writing complex routines in assy, which I am able to, being a hardware man at heart. It is high time I learned proper C and Assy.

    I feel like a fool when I visit various fora and cannot follow what is being discussed.

    I have found this book on the internet and will have it printed. It might just be the trick.
    ( printed vs read from a screen )

    The C Book1
    Mike Banahan, Declan Brady, Mark Doran
    January 1991

Children