[SOLVED] Urgent Questionon keil c51

Status
Not open for further replies.

mohamed.elsabagh

Full Member level 2
Joined
Oct 27, 2010
Messages
145
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Activity points
2,320
I have an urgent question on C51 keil compiler, when debuging I found that not all C instructions are converted to assembly and so those instructions are not executed I don't know why.
 

but those lines are not a function, they are lines inside a function, and how can I adjust the compiler optimization?
 

void LCD_Clear(void)
{
uint8_t SFRPAGE_TEMP=0;
SFRPAGE_TEMP=SFRPAGE;
LCD_Busy_Flag_Wait();
/* Enabling weak pullups and output drivers on Port 0,1,2 and 3 are activated*/
/* Setting Port 1(0-3) [DB7-DB6-DB5-DB4] to Push-Pull output mode to enable output direction communication only
Setting Port 1(4-6) [RS-RW-E] to Push-Pull output mode to enable output direction communication only*/
LCD_DATA_MODE |= DATA_MODE_MASK_PUSHPULL;
/************** command ********************/
LCD_CTRL &= ~RW_MASK; //RW=0
LCD_CTRL &= ~RS_MASK; //RS=0
LCD_CTRL &= ~E_MASK; //E=0
LCD_DATA &= 0xF0; //DB4=DB5=DB6=DB7=0

/************** Dummy instruction **********/
// LCD_CTRL &= ~RW_MASK; //RW=0
/******************E-Cycle*****************/
E_Cycle();
/******************************************/
LCD_DATA |= 0x01; //DB4=1
/******************E-Cycle*****************/
E_Cycle();
/******************************************/
SFRPAGE=SFRPAGE_TEMP;
}

This is an example the 5 instructions before the dummy instruction are not converted to assembley but if I rempve the comment from the dummy instruction they will be converted normally but they may have impact on other instructions in the file. The problem as yo said is due to optimization issue of the compiler but I w'd like to know the different options of the optimization Thank you so much
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…