Hai When simulating, keil IDE Skips some bit manipulating instructions.I think there is some point in that which I cannot locate.please pont out Roy Thomas
It would be a lot easier to answer meaningfully if you had bothered to specify which instructions are being skipped, in what context. Please don't assume your audience to be clairvoyant.
Sorry for being not clear in the last post.I was off the impression that being a newcomer I may be ignorant of some very common rules of keil. I am just starting in C and Keil .Sorry if my code looks awkward
sbit LCD_EN = P0^4; sbit LCD_RW = P0^5; sbit LCD_RS = P0^6; void lcd_ini(void) { delayUs(0x40); LCD_RW = 0; // write operation LCD_RS = 0; // write to command register P0 =(P0 & 0xF0) | 0x03; delayUs(0x10); LCD_EN = 0; LCD_EN=1; LCD_STROBE; delayUs(0x20); LCD_STROBE; LCD_EN = 0; LCD_EN=1; delayUs(0x30); LCD_STROBE; delayUs(0x25); LCD_EN =0;// /These //two //instructions are skipped LCD_EN=1; delayUs(0x50); P0 &= 0xFE; delayUs(0x23); LCD_STROBE; delayUs(0x50); //this is my delay void delayUs(unsigned char del) { unsigned char delloc; for(delloc=0;delloc <= del;delloc++) { } }
When simulating, keil IDE Skips some bit manipulating instructions.I think there is some point in that which I cannot locate.please pont out Sorry for being not clear in the last post.I was off the impression that being a you are still "not clear". Repost your code (thanks for using pre) with the "Skips some bit manipulating instructions" marked. Erik
I caught it. They are probably optimized out. Erik
Hai I think I have found some clue. Some are optimised out and some others are actually not skipped,but they are merged with the nearby delay routines. Could be seen in the dissassembly window like that. But when stepping through C sourse they appear to be skipped. Causes some confusion but code is there eventhough not like how I proposed!! . Any way how I can avoid such merging! Thanks Roy Thomas
Any way how I can avoid such merging! set the minimum optimization you can live with and there will still be some "merging". A C compiler is supposed to be efficient and thus debugging via C source is sometimes confoosing. When wondering, set the breakpoint in the disassembly and see what actually happens. This phenomena is not a "Keil bug" I know of no decent compiler that does not show such behaviour. Erik
That's why it's called an Optimising compiler! http://www.keil.com/c51/c51_opt.htm Almost every 'C' compiler these days is an "Optimising" compiler.