]> hackdaworld.org Git - my-code/arm.git/blob - betty/startup.s
betty.c - first test fw to writo to flash bank0
[my-code/arm.git] / betty / startup.s
1 #
2 # startup.s - starup code for the lpc2220
3 #
4 # author: hackbard@hackdaworld.org
5 #
6
7 #
8 # some definitions
9 #
10
11 # sram
12
13 .equ    sram_size,      (64*1024)
14 .equ    sram_addr,      0x40000000
15 .equ    sram_top,       (sram_addr+sram_size-4)
16
17 # stack
18
19 .equ    stack_size,     (2*1024)
20 .equ    stack_top,      sram_top
21 .equ    stack_limit,    (sram_top-stack_size)
22
23 #
24 # the startup code
25 #
26
27 .text
28 .arm
29
30         # init stack pointer
31
32         ldr r0, =sram_top
33         mov sp, r0
34         ldr r0, =stack_limit
35         mov sl, r0
36
37         # jump to c code
38
39         adr lr, loop_forever
40         mov r0, #0
41         mov r1, #0
42         ldr r2, =main
43         bx r2
44
45 loop_forever:
46         b loop_forever
47