hi i am using a evaluation version of keil...i would like to know how i can use asm instructions when i am c-language.for example mov A,#10h and what is inline assmebly means...
Why do you think this might be necessary? When you use a high-level language (eg, 'C'), you delegate responsibility for implementation details to the compiler; in particular, you give the compiler control of which registers it uses for what and when. Clearly, if you start randomly throwing values into registers that the compiler is using, you will truly mess things up. Now C51's use of registers is documented in the Manual - but don't even think of messing with inline assembler until you have thoroughly studied and understood it! If you have something that really needs to be done in assembler (and there are such things), then write a separate assembler function to do it! http://www.keil.com/support/man/docs/c51/c51_ap_ctoasm.htm
thanx for the answer....but if i have to make a timer based delay in my program.the how i will wite it in my c prog...i meam just writing the mnemonics will do or not...and i heard that there are some compiler in which if u have to use a assembly code in between you have to prefix it with asm for eg:asm nop...is it necessary in keil also...
Sounds like you have never written a program in 'C' before? Therefore, the first thing you need to do is to spend some time to learn the 'C' language. Having learned the general language, you can then turn to the manual for the specific compiler (Keil C51, in this case). The compiler manual will tell you what extensions it provides to the general language to address the specific details of the target processor (the 8051, in this case). You should certainly not do anything else before you have read the uVision Getting Started Guide, and worked through the example projects in it. This will give you a proper introduction to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep end. (The uVision Getting Started Guide is available on the 'Books' tab in the 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS51.PDF in your Keil folder) Once you've got a grip of the tools, you can go to the Downloads section of this website; there you'll find plenty of examples - including the use of the 8051's Timers in C51.
i have to make a timer based delay in my program.the how i will wite it in my c prog... In C if u have to use a assembly code what does it matter to you what micro has to do Erik