micro68/runtime/crt0.s
2026-08-04 18:27:00 +09:00

105 lines
2.4 KiB
ArmAsm

STACK_AREA equ $1ff000
ROM equ $000000
RAM equ $100000
section VECTORS
vector_table:
dc.l STACK_AREA
dc.l init
dc.l unhandled_exception ; 2: bus error
dc.l unhandled_exception ; 3: address error
dc.l unhandled_exception ; 4: illegal instruction
dc.l unhandled_exception ; 5: zero divide
dc.l unhandled_exception ; 6: chk
dc.l unhandled_exception ; 7: trapv
dc.l unhandled_exception ; 8: privilege violation
dc.l unhandled_exception ; 9: trace
dc.l unhandled_exception ; 10: 1010
dc.l unhandled_exception ; 11: 1111
dc.l unhandled_exception ; 12: -
dc.l unhandled_exception ; 13: -
dc.l unhandled_exception ; 14: -
dc.l unhandled_exception ; 15: uninitialized interrupt
dc.l unhandled_exception ; 16: -
dc.l unhandled_exception ; 17: -
dc.l unhandled_exception ; 18: -
dc.l unhandled_exception ; 19: -
dc.l unhandled_exception ; 20: -
dc.l unhandled_exception ; 21: -
dc.l unhandled_exception ; 22: -
dc.l unhandled_exception ; 23: -
dc.l unhandled_exception ; 24: spurious interrupt
dc.l timer_irq ; 25: l1 irq
dc.l unhandled_exception ; 26: l2 irq
dc.l unhandled_exception ; 27: l3 irq
dc.l unhandled_exception ; 28: l4 irq
dc.l unhandled_exception ; 29: l5 irq
dc.l unhandled_exception ; 30: l6 irq
dc.l unhandled_exception ; 31: l7 irq
dc.l unhandled_exception ; 32: trap 0
dc.l unhandled_exception ; 33: trap 1
dc.l unhandled_exception ; 34: trap 2
dc.l unhandled_exception ; 35: trap 3
dc.l unhandled_exception ; 36: trap 4
dc.l unhandled_exception ; 37: trap 5
dc.l unhandled_exception ; 38: trap 6
dc.l unhandled_exception ; 39: trap 7
dc.l unhandled_exception ; 40: trap 8
dc.l unhandled_exception ; 41: trap 9
dc.l unhandled_exception ; 42: trap 10
dc.l unhandled_exception ; 43: trap 11
dc.l unhandled_exception ; 44: trap 12
dc.l unhandled_exception ; 45: trap 13
dc.l unhandled_exception ; 46: trap 14
dc.l unhandled_exception ; 47: trap 15
section CODE
xref _main
xref _tick
xref _DATA_LOAD
xref _DATA_START
xref _DATA_END
xref _BSS_START
xref _BSS_END
init:
move.w #$2700,sr
lea _DATA_START,a0
lea _DATA_END,a1
lea _DATA_LOAD,a2
jsr copy
lea _BSS_START,a0
lea _BSS_END,a1
jsr clear
jsr _main
move.w #$2000,sr
bra.s *
copy:
cmpa.l a1,a0
bhs.s .done
move.l (a2)+,(a0)+
bra.s copy
.done:
rts
clear:
cmpa.l a1,a0
bhs.s .done
clr.l (a0)+
bra.s clear
.done:
rts
unhandled_exception:
bra.s *
timer_irq:
jsr _tick
rte