-
Notifications
You must be signed in to change notification settings - Fork 0
/
crt0.s
51 lines (40 loc) · 770 Bytes
/
crt0.s
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
43
44
45
46
47
48
49
50
51
;; crt0.s for the Amstrad NC100 (Z80)
;; startup code for PCMCIA program cards
.module crt0
.globl _main
.area _HEADER (ABS)
;; Reset vector
.org 0xC200
.ascii "NC100PRG"
.org 0xC210
jp init
.ascii "SD BOOT"
.db 0x00
.org 0xC220
init:
;; Stack at the top of memory.
;; ld sp,#0xffff
;; Initialise global variables
call gsinit
call _main
jp _exit
;; Ordering of segments for the linker.
.area _HOME
.area _CODE
.area _GSINIT
.area _GSFINAL
.area _DATA
.area _BSS
.area _HEAP
.area _CODE
__clock::
ld a,#2
rst 0x08
ret
_exit::
;; Exit - quit to main menu
ret
.area _GSINIT
gsinit::
.area _GSFINAL
ret