關於sdcc的下載,請參閱:https://zh.arslanbar.net/post.php?t=23368
新建一個空文件夾,名字隨便取,這裡取use_sdcc。
編寫一個c文件,名稱為test.c,內容:
#include <at89x51.h>
#define SEG7_POINT 0x7f
unsigned char seg7code[] = {0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90};
void main()
{
while (1)
P0 = seg7code[4] & SEG7_POINT;
}