amiga_boottest

view src/startup.s @ 2:58ebd84822e7

it works
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 22 Feb 2018 12:44:20 +0200
parents 48093e4bd99a
children
line source
1 | vi:filetype=gas68k:
2 .global halt_cpu
3 .extern main
5 .section .startup,"a"
7 | enter supervisor mode (assumes VBR=0)
8 move.l #super, 0x80
9 trap #0
10 super:
11 ori.w #0x0300, %sr | disable interrupts
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
23 move.l #_stacktop, %sp
24 andi.w #0xf8ff, %sr | enable interrupts
26 jsr main
27 0: bra.b 0b
29 halt_cpu:
30 stop #0x2700