这汇编程序,,,那里出了死循环。。。
嶶風 2011-11-08 11:32:21 #include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^6;
sbit wela=P2^7;
sbit d0=P1^0;
uint x,y,z,a,mun;
uchar temp ,table[]={
0x3f/*0*/,0x06/*1*/,0x5b/*2*/,0x4f/*3*/,
0x66/*4*/,0x6d/*5*/,0x7d/*6*/,0x07/*7*/,
0x7f/*8*/,0x6f/*9*/,0x77/*a*/,0x7c/*b*/,
0x39/*c*/,0x5e/*d*/,0x79/*e*/,0x71/*f*/};
void delay(uint z);
void main()
{
EA=1;
EX0=1;
TCON=0x01;
mun=0;
temp=0xfe;
while(1)
{
wela=1;
P0=temp;
wela=0;
d0=1;
dula=1;
P0=table[mun];
dula=0;
delay(100);
mun++;
if(mun==6)
mun=0;
temp=_crol_(temp,1);
if(temp==0xbf)
temp=0xfe;
}
}
void yy0() interrupt 0
{
d0=0;delay(10);
}
void delay(uint z)
{
for(x=200;x>0;x--)
for(y=z;y>0;y--);
}
自己写的,,,,多包涵。。。。