为什么我的一段液晶初始化程序被编译成这样了,已经不符合初始化操作的流程了。
具体清单如下: 编译器版本:WinAVR-20070525 单片机型号:AT90CAN128。 优化等级采用-01,02,03,0s都一样。
================================= c源程序 ================================= #include <avr/io.h>
#define LCD_DATA_PORT 0x6820 #define LCD_COM_PORT 0x6821
void InitLcd() { uint8_t * pt1;
pt1 = (uint8_t *)LCD_DATA_PORT; *pt1 = 0x00; *pt1 = 0x00; pt1 = (uint8_t *)LCD_COM_PORT; *pt1 = 0x42; pt1 = (uint8_t *)LCD_DATA_PORT; *pt1 = 0x1E; *pt1 = 0x00; pt1 = (uint8_t *)LCD_COM_PORT; *pt1 = 0x43; }
int main( void ) { InitLcd(); while (1); }
===================================== 经过编译后得到的InitLcd子程序汇编代码 ===================================== InitLcd(): 0000006B: 92106820 STS 0x6820,R1 0000006D: E483 LDI R24,0x43 0000006E: 93806821 STS 0x6821,R24 00000070: 9508 RET
|