?? api_segment_init.c
字號:
#include <string.h>
#include "segment_init.h"
#pragma language=extended
#pragma segment="INITTAB"
__root void init_ram_code()
{
InitBlock_Type const * const initTableBegin = __sfb( "INITTAB" );
InitBlock_Type const * const initTableEnd = __sfe( "INITTAB" );
InitBlock_Type const * initTableP;
for (initTableP=initTableBegin; (int)initTableP<(int)initTableEnd; initTableP++)
{
if (initTableP->Src == initTableP->Dst)
{
memset(initTableP->Dst, 0, initTableP->Size);
}
else
{
memcpy(initTableP->Dst, initTableP->Src, initTableP->Size);
}
}
asm("nop\n");
asm("nop\n");
asm("nop\n");
asm("nop\n");
asm("nop\n");
memcpy((char *)0x20000000,(char *)0x40003000,0x428);
memcpy((char *)0x20000428,(char *)0x40003428,0x1b8); // for close remap
//memcpy((char *)0x20000428,(char *)0x40003428,0x1d4); // for open remap
memcpy((char *)0x200005E0,(char *)0x400038DC,0x144); // close
//memcpy((char *)0x200005E0,(char *)0x400038f8,0x144); // open
asm("b 0x40003000");
}
#pragma language=default
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -