#include
#include "../inc/sopc.h"
#include "system.h"
#include "string.h"
/*--------------------------------------------------------------- * Variable *---------------------------------------
*/
unsigned short * ram = (unsigned short *)(SDRAM_BASE+0x10000); //SDRAM地址
/*
* === FUNCTION ========================================
* Name: main * Description: 函数主程序 * =====================================================
*/
int main(void)
{
int i;
memset(ram,0,100); //向ram中写数据,当ram写完以后,ram的地址已经变为(SDRAM_BASE+0x10100)
for(i=0;i<100;i++){
*(ram++) = i;
}
//逆向读取ram中的数据
for(i=0;i<100;i++){
printf("%d\n",*(--ram));
}
return 0;
}