Problem description: Use the Keil C51 compiling environment with a font LCD. some Chinese characters cannot be displayed when such a statement is used: uchar code coun_show1 [] = {"Please enter the first operand"}; the number of Chinese characters will not be displayed, replace the preceding Chinese characters with simplified Chinese encoding, for example, uchar code coun_show1 [] = {0xc7, 0xeb, 0xca, 0xe4, 0xc8, 0xeb, 0xb5, 0xda, 0xd2, 0xbb, 0xb2, 0xd9, 0xd7, 0xf7, 0xca, 0xfd}; the numbers of Chinese characters can be displayed on the LCD screen. the Chinese characters "Number" are encoded as 0xca and 0xfd. we also found some Chinese characters, such as "in addition to" (Simplified Chinese encoding: 0xb3, 0xfd) and "3" (Simplified Chinese encoding: 0xc8, 0xfd, we also found that the two Chinese characters that cannot be displayed have one thing in common: the second byte of Simplified Chinese encoding is 0xfd.
This was a long time ago problem. It should be traced back to this problem when I was preparing for an electronic competition for college students while I was at work. it is only possible to analyze the bug of the compiler, because the LCD can be displayed in simplified Chinese encoding, but it has not been confirmed. I knew that I had been hanging out on the Internet a few days ago and saw a patch before I realized that my original conjecture was correct.
It turns out that this is indeed a compiler BUG: during compilation, Keil C51 will filter out the characters 0xfd (some Chinese characters contain the internal code of this character, such as the Chinese character "Number"), resulting inProgramError. Especially when LCD Chinese characters are displayed.
To address this bug, some netizens have created a patch. After downloading the patch, put it in your Keil/C51/bin directory and run the program. You can. v8.02 is supported.
You can go to this site to download the patch: http://share.eepw.com.cn/share/download/id/17061
Or go to this website to download the patch: http://www.cndzz.com/down/soft/39675.htm
PS: as we are mainly engaged in arm, Keil C51 is basically not used, so I have not tested the above patches.