annotate src/startup.s @ 1:2560a8be8cb8
hblank interrupt test
author |
John Tsiombikas <nuclear@member.fsf.org> |
date |
Tue, 14 Mar 2017 09:02:43 +0200 |
parents |
ce1b05082ac4 |
children |
b22bc95f0cc0 |
rev |
line source |
nuclear@0
|
1 .text
|
nuclear@0
|
2 .extern main
|
nuclear@0
|
3
|
nuclear@0
|
4 .global start
|
nuclear@0
|
5 .global halt_cpu
|
nuclear@0
|
6 start:
|
nuclear@1
|
7 jsr disable_intr
|
nuclear@0
|
8
|
nuclear@0
|
9 | copy .data section from ROM to RAM
|
nuclear@0
|
10 move.l #_data_lma, %a0
|
nuclear@0
|
11 move.l #_data_start, %a1
|
nuclear@0
|
12 move.l #_data_end, %a2
|
nuclear@0
|
13 cmp.l %a1, %a2
|
nuclear@0
|
14 beq.s 1f | skip data copy if the section is empty
|
nuclear@0
|
15 0: move.l (%a0)+, (%a1)+
|
nuclear@0
|
16 cmp.l %a1, %a2
|
nuclear@0
|
17 bne.s 0b
|
nuclear@0
|
18 1:
|
nuclear@0
|
19
|
nuclear@0
|
20 | zero the .bss section
|
nuclear@0
|
21 move.l #_bss_start, %a0
|
nuclear@0
|
22 move.l #_bss_end, %a1
|
nuclear@0
|
23 cmp.l %a0, %a1
|
nuclear@0
|
24 beq.s 1f | skip bss zeroing if the section is empty
|
nuclear@0
|
25 0: clr.l (%a0)+
|
nuclear@0
|
26 cmp.l %a0, %a1
|
nuclear@0
|
27 bne.s 0b
|
nuclear@0
|
28 1:
|
nuclear@0
|
29
|
nuclear@0
|
30 | setup the stack pointer stack
|
nuclear@0
|
31 move.l #_stacktop, %sp
|
nuclear@0
|
32 | now that we have a stack, we can enable interrupts
|
nuclear@1
|
33 jsr enable_intr
|
nuclear@0
|
34
|
nuclear@0
|
35 jsr main
|
nuclear@0
|
36 halt_cpu:
|
nuclear@0
|
37 stop #0x2700
|