I am using following code by enabling FILE-OPTIONS-ASSEMBLE SRC FILE flag in one of my test.C file.
In test.c file I used following code: #pragma asm NOP #pragma endasm
After inclding generated test.SRC file in project browser, when I compile will get following error:
test.SRC(127): error A9: SYNTAX ERROR
In test.src file at 127 line I observed following line of statement:
<DPTR DATA 082H>
What's the worng with this?
why not use the canned _nop_ macro
"I am using following code by enabling FILE-OPTIONS-ASSEMBLE SRC FILE flag in one of my test.C file."
Have you also enabled the generate assembler source option?
But, as Erik says, why not just use the _nop_() Intrinsic function? http://www.keil.com/support/man/docs/c51/c51_lib_intrinsic.htm
But, as Erik says, why not just use the _nop_() Intrinsic function? An additional comment If you use the Keil kludged inline assembly (I do not have a problem with it, I'd never use inline assembly anyhow - but it IS kludged) you lose the C source based debug and THAT is a pain.
Anyhow, if you need a nop in C code you are using the wrong tool regardless, how are you going to ensure in any way that the reamining C is going to time as you want next time you com,pile it.
Well, since two different persons have the same problem, I guess it is schoolwork.
Erik
"two different persons have the same problem"
See: http://www.keil.com/forum/docs/thread9887.asp