源程序:
#include<reg51.h>
#include<absacc.h>
#define uchar unsigned char
#define uint unsigned int
#define IN0 XBYTE[0x7FF8]
uchar code duanma[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar code weima[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};
sta
tic uchar data s[4];
uchar xdata *ad_adr;
uchar i,j=0,w=0;
void delay(uint m)
{uint n;
while(m--)
for(n=0;n<250;n++);
}
void main()
{IT0=1;
EA=1;
EX0=1;
i=0;
ad_adr=&IN0;
*ad_adr=i;
while(1);
}
void int0() interrupt 0
{uint k;
uchar getdata,first,second;
s[j]=P0;
getdata=s[j];
first=getdata*196/10000;
second=getdata*196%10000/1000;
for(k=0;k<2;k++)
{P2=weima[w];
if(w%2==0) P1=duanma[first]|0x80;
else P1=duanma[second];
if(w<8) w++;
else w=0;
delay(2);}
ad_adr++;
j++;
if(j<4) *ad_adr=i;
else {ad_adr=&IN0;*ad_adr=i;}
}
-
运行前
-
运行后
没看程序,很简单!你知道ALE是干什么的吗!希望能多理解理解!提示:地址数据总线!
一周热门 更多>