void time0()interrupt 1 using 1//T/C0中断服务程序入口
{
uint dac0;
uchar x,y;
uchar i,j=0,a;
sbr ++;
TH0=(65536-49981)/256;//计数初值重新装入
TL0=(65536-49981)%256;
if(sbr==2)
{
time1++;
sbr=0;
i=P1;
j=0x02;
if(i&j)
{
if(time1==time)
{
time1=0;
i=P1;
j=0x01;
if(i&j) //1
{
if(sh)
{
if(dac>0)
{
dac=dac--;
pl=pl--;
}
else
{
dac=0;
pl=0;
}
}
else
{
if(dac>tiao)
{
dac=dac-tiao;
pl=pl-tiao;
}
else
{
dac=0;
pl=0;
}
}
}
else //1
{
if(sh)
{
if(dac<1000-tiao)
{
dac=dac+tiao;
pl=pl+tiao;
}
else
{
dac=1000;
pl=1000;
}
}
else
{
if(dac<1000)
{
dac++;
pl++;
}
else
{
dac=1000;
pl=1000;
}
}
}
sh=i&j;
}
}
else
{
i=P1;
j=0x0c;
a=i&j;
if(a==0x04)
{
if(dac>0)
{dac--;
pl--;}
else
{dac=0;
pl=0;}
}
else if(a==0x08)
{
if(dac<1000)
{dac++;
pl++;}
else
{dac=1000;
pl=1000;
}
}
}
x=dac/256;
y=dac%256;
dac0=dac*4;
tlv_5616(da); //调用da程序;
wrnbyt(0xa0,0x00,x);
wrnbyt(0xa0,0x01,y);
}
}
这段程序大概什么功能?请帮忙重点解释下有颜色的部分 |