大冢幫幫忙
我剛學c,自寫了秒表程序.編譯會出現*** error 65: access violation at C:0x64FF : no 'execute/read' permission; 不知什麼問題,請大冢幫幫.程序在此幫我下什麼問題
#include <reg51.h>
sbit P2_1=P2^1;
sbit P2_2=P2^2;
unsigned char code tab[]={0x28,0x34,0x28,0x34,0x0a9,0x60,0x20,0x7a,0x20,0x21,0x61,0x74,0x30,0x62,0xa2,0x7e};
void delay(void)
{
unsigned char i,j;
for(i=0;i <100;i++)
for(j=0;j <255;j++);
}
void main(void)
{
unsigned char scend,tcend;
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
scend=0;
tcend=0;
P2_1=0;
P0=tab[tcend/10];
P2_1=1;
delay();
P2_2=0;
P0=tab[tcend%10];
P2_2=1;
if(TF0==1)
{
scend++;
if(scend==20)
{
scend=0;
tcend++;
if(tcend==60)
{
tcend=0;
}
TF0=0;
P2_1=0;
P0=tab[tcend/10];
P2_1=1;
delay();
P2_2=0;
P0=tab[tcend%10];
P2_2=1;
}
}
}
发表时间:2006年3月12日20:51:29