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

Assembly and C51

Hello,there: I have met a tough quesiton, how to program with C and Assembly in the project using KEIL(verison 3.0), for example, I wana program the frame with C, and the functions with assembly, especially for RTC conditions, hope someone to give some advice, great thanks advance!

Parents
  • You want to, or you need to?

    What exactly do you hope to gain by mixing C and assembler like that?

    When speed is of concern, then you normally move one or more levels of functions totally into assembler - the part where 90+ percent of the execution time is spent.

    If you are going to replace all your functions and just keep the skeletons, then it feels better to design from scratch with assembler and macros.

Reply
  • You want to, or you need to?

    What exactly do you hope to gain by mixing C and assembler like that?

    When speed is of concern, then you normally move one or more levels of functions totally into assembler - the part where 90+ percent of the execution time is spent.

    If you are going to replace all your functions and just keep the skeletons, then it feels better to design from scratch with assembler and macros.

Children
  • Thanks so much, there's not much necessary for me to write assembly, it is my interest that forces me to take a deep understanding of the interface of C51 and assembly, I have got the knowlegement that C51 compiler has a great optimize with C code and makes the best resource of the hardware. If I known the interface of C51 and assembly, I could write my C code more efficient, and know the resources used in my project or exploration.