start up file code

Discussion in 'Embedded Systems and Microcontrollers' started by embed_v, Nov 24, 2010.

  1. embed_v

    Thread Starter New Member

    Aug 30, 2010
    this is the start up file code but i want to write the same code in C so help me to convert this code to C i am using uv4 (rvmdk).ProcessorInit ; ; Copy the code image from flash to SRAM. ; if :def:_FLASH_PATCH_COMPATIBLE movs r0, #0x800 else movs r0, #0x0000 endif movs r1, #0x0000 movt r1, #0x2000 import ||Image$$SRAM$$ZI$$Base|| ldr r2, =||Image$$SRAM$$ZI$$Base||copy_loop ldr r3, [r0], #4 str r3, [r1], #4 cmp r1, r2 blt copy_loop ; ; Zero fill the .bss section. ; movs r0, #0x0000 import ||Image$$SRAM$$ZI$$Limit|| ldr r2, =||Image$$SRAM$$ZI$$Limit||zero_loop str r0, [r1], #4 cmp r1, r2 blt zero_loop ; ; Set the vector table pointer to the beginning of SRAM. ; movw r0, #(NVIC_VTABLE & 0xffff) movt r0, #(NVIC_VTABLE >> 16) movs r1, #0x0000 movt r1, #0x2000 str r1, [r0]
  2. AlexR

    Well-Known Member

    Jan 16, 2008
    Your code it totally unreadable!
    Format your the code and use the code (#) tags in advanced edit mode to preserve code formatting.