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 code embedded in C code

Hi all,

I am using the chip C8051F020 manufactured by Cygnal Integrated Products. My compiler is C51. How can I include a assembly code in the C code to implement a clock of 8MHz. I tried using for loop with a count of 1, it delivers only a clock of maximum 170Khz.

If I can use a assembly code just three or four NOP instruction will give me the clock which i require.

Please help me
rgds,
Deepak

Parents Reply Children
  • A far better approach would be to write a separate assembler function in a separate assembler source file, and call that function form your 'C' code.

    even better:
    write a skeleton function in C. use the SRC directive to extract the assembly and use that as a base for a separate assembler function in a separate assembler source file

    Erik