	.text

	.extern		main
	.extern		_sdata_loadaddr
	.extern		_sp_base
	.extern		SysTick_Handler
	#  Top of Stack
	.long _sp_base 
	# Reset Handler
	.long _startup+1
	.org 0x0C
	# HardFault
	.long BreakPoint_Handler + 1
	.org 0x3C
	# SysTick Handler
	.long SysTick_Handler + 1
	# USART1
	.org 0xD4
	.long USART_handler + 1

.org 0xEC
	.global _startup
_startup:
        LDR     r1, =_sdata_loadaddr
        LDR     r2, =_sdata
        LDR     r3, =_edata
__copy_loop:
        LDRB    r4, [r1]
        STRB    r4, [r2, #0]
        ADD     r1, r1, #1
        ADD     r2, r2, #1
        CMP     r3, r2
        BGT     __copy_loop
	
	LDR     R0, =main
	LDR	R1, =0x1
	ORR     R0, R1
        BX      R0


		