summaryrefslogtreecommitdiffhomepage
path: root/src/32x0/32x0_boot.32x
blob: 5256293135862aadb6b581c52ab7ac1393864096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;; 32x0 Runtime zero routine
;; org: 0x1000 (very different from the 64x0)
;; interrupts: 0x800 (much like the 64x0)
;; brief: jump to main

;; Copyright 2024, Amlal El Mahrouss, all rights reserved.

%def ROMBOOT_BASE $1000

org ROMBOOT_BASE

move.w r0, __vector_interrupts_table
move.w r1, __vector_interrupts_table_length
move.w r2, 0

__vector_L1:
    move.b [r0+r2], [$800+r2]
    incr r2
    cmp r2, r1
    je __vector_done
    jmp __vector_L1

__vector_done:
    ;; forth interpreter and setup it's stack.
    move.w sp, $7c00
    jmp $8000

    mh

__vector_interrupts_table:
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0
    dw 0

__vector_interrupts_table_length:
    dw 9