1、 1 1 C51 1 auto extern station register 1 auto char a,b/a b auto char a,b auto int x,y/x y#include/*/#include/*/void initUart(void);/*/void main(void)/*main*/char ab=a;/*,ab a*/initUart();/*/char ab=b;/*ab b*/printf(%cn,ab);/*b*/printf(%cn,ab);/*a*/while(1);/*/void initUart(void)/*11.0592MHz 9600*/S
2、CON=0 x50;TMOD|=0 x20;TH1=0 xfd;TR1=1;TI=1;b a 2 extern 2 extern extern#include/*/#include/*/void initUart(void);/*/unsigned int ab=1234;void main(void)/*/extern cd;initUart();/*/printf(ab=%u,cd=%un,ab,cd);while(1);cd=5678;/*/void initUart(void)/*11.0592MHz 9600*/SCON=0 x50;TMOD|=0 x20;TH1=0 xfd;TR1
3、=1;TI=1;ab=1234,cd=5678 3 static#include/*/#include/*/void initUart(void);/*/void main()char i;initUart();/*/for(i=0;i3;i+)static int x=1;int y=1;printf(x=%d,x);printf(y=%dn,y);x+;y+;while(1);/*/void initUart(void)/*11.0592MHz 9600*/SCON=0 x50;TMOD|=0 x20;TH1=0 xfd;TR1=1;TI=1;x=1 y=1 x=2 y=1 x=3 y=1
4、 (4)register CPU C51 2 51 ROM 0000H0FFFH片内ROM1 EA 1000HFFFFH片外ROM0000H0FFFH0 EA 片外ROM0000H1FFFH片内ROM1 EA 2000HFFFFH片外ROM0000H1FFFH0 EA 片 外ROM 52 ROM 2 code RAM 80HFFHSFR00H7FH片 内RAM80HFFH片内RAM80328052 51 RAM 0000HFFFFH片 外RAM64KB data idata pdata xdata 2 C51 data 128B bdata(20H2FH 16B idata 256B RAM
5、pdata 256B MOVX Ri P2 xdata 64KB MOVX DPTR code 64KB MOVC 2 char data a;char idata b;char pdata c;char xdata d;char bdata e;C51()00H 1FH 32 data idata 20H 2FH 16 bdata data 30H 7FH 80 data idata data idata 80 H FFH 128 idata 80H FFH 128 data()0000H FFFFH 65536 code 0000H FFFFH 65536 xdata pdata pdata xdata