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
Not surprisingly, the manual addresses this topic. http://www.keil.com/support/man/docs/c51/c51_asm.htm
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. This is also described in the manuals, and has been discussed here many times before - just search!
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