basic terminal
[cortex-from-scratch] / start.asm
1         .equ STACK_TOP, 0x20010000 /* placed at 32kB, TODO: could place at top of SRAM? */
2         .text
3         .global _start
4         .global reset, nmi, hardfault
5         .code 16
6         .syntax unified
7 _start:
8         .word STACK_TOP, reset, nmi, hardfault
9         .type reset, function
10
11 /* A reset vector (or bootcode) will call main in main.c
12    this is the so called 'entry to C' */
13 reset:
14         b main
15         b reset 
16
17 /* These are consequently the nmi and hardfault vector handlers
18    before booting and entering main, these can actually be called
19    (machine somehow has a failure). That's why they are included here.
20    Later the interrupt vector
21    will be relocated to SRAM and the will be copied / modified.  */
22
23 nmi:
24         b nmi
25
26 hardfault: 
27         b hardfault
28 .global stub
29 stub:
30         ldr R0,=10
31         mov R1,#0
32         udiv.w R2, R0, R1 
33
34         .data
35         .word 'x' 
36         .end
37