这是初始化启动汇编代码:
IMPORT main
AREA Init,CODE,READONLY
ENTRY
LDR R0, =0x7E004000
LDR R1, =0x0
STR r1, [r0]
LDR SP,=0x0FFFFFFF
BL main @ ?÷??C???ò????main????
B.
END
这是main函数:
#define rGPKCON0 (*(volatile unsigned *)(0x7F008800)) //rGPKCON0
#define rGPKDATA (*(volatile unsigned *)(0x7F008808)) //rGPKDATA
void Delay(unsigned int x)
{
unsigned int a,b,c;
for(a=0;a<x;a++)
for(b=0;b<0xff;b++)
for(c=0;c<0xff;c++);
}
int main()
{
rGPKCON0=0x11112222;
while(1)
{
rGPKDATA=0x0f;//????
delay(10);
rGPKDATA=0xff;//????
delay(10);
}
return 0;
}
错误:
Warning : #223-D: function declared implicitly
main.c line 16 delay(10);
Warning : #111-D: statement is unreachable
main.c line 20 return 0;
Warning : #1-D: last line of file ends without a newline
main.c line 21 }
compiler : D:\tiny6410\?ú??Tiny6410???í°?-DISC4\????3?¨ARM???????×°à??\??3?ì?¨LED???????ò?è????\led_zzf\main.c: 3 warnings, 0 errors
Error : A1163: Unknown opcode main , expecting opcode or Macro
startup.s line 1 IMPORT main
armasm : 1 00000000 IMPORT main
Error : A1163: Unknown opcode Init,CODE,READONLY , expecting opcode or Macro
startup.s line 2 AREA Init,CODE,READONLY
armasm : 2 00000000 AREA Init,CODE,READONLY
Error : A1355: A Label was found which was in no AREA
startup.s line 3
armasm : 3 00000000 ENTRY
armasm : 3 Errors, 0 Warnings
Error : armasm Compile exit status = 2
帮忙看一下,我是初学者,其多多赐教!!谢谢啦!
------解决方案--------------------
你的RVDS破解好了吗?
试试别人的程序,看看会不会编译错误!