amiga_boottest

view src/startup.s @ 1:48093e4bd99a

stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 Feb 2018 18:00:45 +0200
parents 51422ea54b9d
children 58ebd84822e7
line source
1 | vi:filetype=gas68k:
2 .global start
3 .global halt_cpu
4 .extern main
6 .section .text.startup
8 | enter supervisor mode (assumes VBR=0)
9 move.l #super, 0x80
10 trap #0
11 super:
12 ori.w #0x0300, %sr | disable interrupts
14 | zero the .bss section
15 move.l #_bss_start, %a0
16 move.l #_bss_end, %a1
17 cmp.l %a0, %a1
18 beq.s 1f | skip zeroing if the section is empty
19 0: clr.l (%a0)+
20 cmp.l %a0, %a1
21 bne.s 0b
22 1:
23 | setup the stack
24 move.l #_stacktop, %sp
25 andi.w #0xf8ff, %sr | enable interrupts
27 jsr main
28 0: bra.b 0b
30 halt_cpu:
31 stop #0x2700