li cang

run the code in ram under asm.

Discussion created by li cang on Jun 8, 2010
Latest reply on Jun 8, 2010 by li cang

I want to copy the boot code into ram and then run it in ram.

Boot code address is 0xf000,memory address is 0x3980.

So I implement the prm as follow:

My prm file:

SEGMENTS /* here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. All addresses are 'logical' */

          ......

          BOOT_MEM      = READ_ONLY   0xF000 TO 0xF9FF RELOCATE_TO 0x3980;

          ......

END

 

PLACEMENT /* here all predefined and user segments are placed into the SEGMENTS defined above. */
          ......

         BootStart          INTO BOOT_MEM;

          ......

END

 

VECTOR 0 BootStart  /* reset vector: this is the default entry point for an Assembly application. */

 

My bootloader code is asm code.

        org $f000
BootStart:

......

 

 

 

But it looks the code can not been copied into ram 0x3980 when we run this project.

In C,it should be okay,I think.But in asm,how to complete it.

 

Thanks ,please help me.

Best Regards.
      

Outcomes