|
楼主 |
发表于 2006-3-18 10:35:19
|
显示全部楼层
原来的init.s:
IMPORT Main
AREA Init,CODE,READONLY
CODE32
GET snds.s
ENTRY
LDR R0,=0x3FF0000
LDR R1,=0xE7FFFF80
STR R1,[R0]
LDR SP,=0x3FE1000
BL Main END
原来的main.c
#define IOPMOD (*(volatile unsigned *)0x03FF5000) //IO port mode register
#define IOPDATA (*(volatile unsigned *)0x03FF500 //IO port data register
void Delay(unsigned int);
int Main()
{
unsigned long LED;
IOPMOD=0xFFFFFFFF;
IOPDATA=0x01;
for(;;){
LED=IOPDATA;
LED=(LED<<1);
IOPDATA=LED;
Delay(10);
if(!(IOPDATA&0x0F))
IOPDATA=0x01;
}
return(0);
}
void Delay(unsigned int x)
{
unsigned int i,j,k;
for(i=0;i<=x;i++)
for(j=0;j<0xff;j++)
for(k=0;k<0xff;k++);
} |
|