我在另一个版块没法解决,只好转移到这来问了,
下面的sbit a=P1^0在multisim里不能用吗?
我用multisim仿真8052时却出了一个问题,仿真不了,代码如下:
#include<8052.h>
sbit a=P1^0;
void delay(void)
{int i,j;
for(i=100;i>0;i--)
for(j=100;j>0;j--);
}
void main()
{a=1;
/* Insert your code here. */
while(1)
{delay();
a=~a;}
}
出错信息则如下:
Multisim - 2011年8月17日, 21:49:36
--------------------------Building: Project: project1---------------------------
Note: -E compiler option was not present. This option has been added to the compiler build command temporarily.
Note: -O compiler option was not present. This option has been added to the compiler build command temporarily.
Warning: C:\Program Files\HI-TECH Software\HC51\lite\9.60\include\8052.h : 3 #warning: Header file 8052.h included directly. Use #include <htc.h> instead.
Warning: D:\360data\ÖØÒªÊý¾Ý\×ÀÃæ\н¨ÎÄ~2\8052\project1\main.c; line 14; column 0; missing n : 0
Warning: D:\360data\ÖØÒªÊý¾Ý\×ÀÃæ\н¨ÎÄ~2\8052\project1\main.c; line 2; column 6; missing ba : 0 d
Error: D:\360data\ÖØÒªÊý¾Ý\×ÀÃæ\н¨ÎÄ~2\8052\project1\main.c; line 2; column 6; "," expect : 0
Error: D:\360data\ÖØÒªÊý¾Ý\×ÀÃæ\н¨ÎÄ~2\8052\project1\main.c; line 2; column 12; constant : 0
Warning: D:\360data\ÖØÒªÊý¾Ý\×ÀÃæ\н¨ÎÄ~2\8052\project1\main.c; line 13; column 6; line does : 0 n the end
编译器结果: 2 - Errors, 4 - Warnings
这究竟是什么原因呢?无尽的感谢啊~