X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Farm.git;a=blobdiff_plain;f=betty%2Fstartup.s;fp=betty%2Fstartup.s;h=bc4ff4177c5c87ca1102cf705f5668c5454ae78b;hp=0000000000000000000000000000000000000000;hb=21b21d3d5c7feb1ece4c8ea3d495e03c502450ea;hpb=cc9a44bee2152e887691958d3580e17ef15810e2 diff --git a/betty/startup.s b/betty/startup.s new file mode 100644 index 0000000..bc4ff41 --- /dev/null +++ b/betty/startup.s @@ -0,0 +1,47 @@ +# +# startup.s - starup code for the lpc2220 +# +# author: hackbard@hackdaworld.org +# + +# +# some definitions +# + +# sram + +.equ sram_size, (64*1024) +.equ sram_addr, 0x40000000 +.equ sram_top, (sram_addr+sram_size-4) + +# stack + +.equ stack_size, (2*1024) +.equ stack_top, sram_top +.equ stack_limit, (sram_top-stack_size) + +# +# the startup code +# + +.text +.arm + + # init stack pointer + + ldr r0, =sram_top + mov sp, r0 + ldr r0, =stack_limit + mov sl, r0 + + # jump to c code + + adr lr, loop_forever + mov r0, #0 + mov r1, #0 + ldr r2, =main + bx r2 + +loop_forever: + b loop_forever +