aimless debugging, forgot -m68000 in the linker command line
[lugburz] / src / amiga / startup.s
1 | vi:filetype=gas68k:
2         .global halt_cpu
3         .extern main
4
5         .section .startup,"a"
6
7         | enter supervisor mode (assumes VBR=0)
8         move.l #super, 0x80
9         trap #0
10 super:
11         ori.w #0x0300, %sr      | disable interrupts
12
13         | zero the .bss section
14         move.l #_bss_start, %a0
15         move.l #_bss_end, %a1
16         cmp.l %a0, %a1
17         beq.s 1f        | skip zeroing if the section is empty
18 0:      clr.b (%a0)+
19         cmp.l %a0, %a1
20         bne.s 0b
21 1:
22         | setup the stack at the top of (traditional) chipmem for now
23         move.l #0x80000, %sp
24         andi.w #0xf8ff, %sr     | enable interrupts
25
26         | initialize early exception handlers
27         jsr exc_init
28
29         jsr main
30 0:      bra.b 0b
31
32 halt_cpu:
33         stop #0x2700