hello i have written code in following way void fonction1(void) { TMOD = (TMOD | 0x20); SCON0 = 0x50; asm { MOV SCON1,#40h } SCON1 = 0x40; }
at the time of Build target it is showing error " 'asm' is undefined symbol" like this in other functions also i want to add assembly code in c function . so how can i resolve this problem . pls help me some body . thank for time
No, it shouldn't - Keil C51 has no such keyword.
You also need to check the C51 Manual.
Again, you can easily get yourself into real trouble by messing with inline assembler when you don't have a thorough understanding of the tools - for which a thorough study of the Manuals is, I'm afraid, unavoidable.
And, in this case, inline assembler is entirely pointless anyhow!
"Also must include option 'assemble SRC file'"
That is true.
Not that it matters much to me because I wouldn't in-line assembler.
Can't find anything in the docs regarding __asm at the moment, but give it a try. The compiler accepts it.
That's because it isn't there!
It's not a (documented) C51 keyword!
See http://www.keil.com/support/man/docs/c51/c51_asm.htm instead...
As I indicated, it doesn't matter much to me - Actually, not at all.
But in my haste to answer the original question, I accidentally stumbled across an undocumented C51 keyword.
Maybe it's my lucky day - And I should get a lottery ticket.
There again, maybe it's my unlucky day - When it comes to lottery tickets it normally is :(
"I accidentally stumbled across an undocumented C51 keyword."
Apparently so!
But, to the OP, I would say again: you can dig yourself into a plenty big enough hole without resorting to undocumented features...!