中易网

请教把下面的单片机汇编语言转换成C语言

答案:2  悬赏:30  
解决时间 2021-01-14 21:55
  • 提问者网友:树红树绿
  • 2021-01-14 10:06
请教把下面的单片机汇编语言转换成C语言
最佳答案
  • 二级知识专家网友:大漠
  • 2021-01-14 10:13
#include
unsigned char a;
void time0()
{
unsigned char m,n;
TR0=1;
m-250;
n=20;
while(n--)while(m--);
TR0=0;
}
void time1()
{
unsigned char m,n,k;
TR0=1;
m=250
n=200;
k=60;
while(k--)while(n--)while(m--);
}
void det1() interrupt 0
{
P0=0x01;
time0();
P0=0x03;
time0();
P0=0x05;
time0();
P0=0x07;
time0();
P0=0x09;
time0();
P0=0x0b;
time0();
P0=0x0d;
time0();
P0=0x0f;
time1();
}
void det0() interrupt 2
{
time1();
TCON=a;
a&=0x01;
if(a!=0)
{
P0=0x0f;
time0();
P0=0x0d;
time0();
P0=0x0b;
time0();
P0=0x09;
time0();
P0=0x07;
time0();
P0=0x05;
time0();
P0=0x03;
time0();
P0=0x01;
}
}
main()
{
P0=0x01;
TMOD=0x02;
TCON=0x10;
IE=0x83;
while(1);
}
全部回答
  • 1楼网友:一把行者刀
  • 2021-01-14 11:02
不懂.....................
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息