OpenCores
URL https://opencores.org/ocsvn/tv80/tv80/trunk

Subversion Repositories tv80

[/] [tv80/] [trunk/] [sc_env/] [app_localcfg/] [zsrc/] [sample_crt0.asm] - Blame information for rev 106

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 ghutchis
        ;; Generic crt0.s for a Z80
2
        .module bintr_crt0
3
        .globl  _main
4
        .globl  _isr
5
        .globl  _nmi_isr
6
 
7
        .area _HEADER (ABS)
8
        ;; Reset vector
9
        .org    0
10
        jp      init
11
 
12
        .org    0x08
13
        reti
14
        .org    0x10
15
        reti
16
        .org    0x18
17
        reti
18
        .org    0x20
19
        reti
20
        .org    0x28
21
        reti
22
        .org    0x30
23
        reti
24
        .org    0x38
25
        di
26
        push    af
27
        call _isr
28
        pop     af
29
        ei
30
        reti
31
 
32
        .org    0x66
33
        push    af
34
        call    _nmi_isr
35
        pop     af
36
        retn
37
 
38
        .org    0x100
39
init:
40
        ;; Stack at the top of memory.
41
        ld      sp,#0x7fff
42
 
43
    ;; enable interrupts
44
        im      1
45
        ei
46
 
47
        ;; Initialise global variables
48
        call    _main
49
        jp      _exit
50
 
51
        ;; Ordering of segments for the linker.
52
        .area   _HOME
53
        .area   _CODE
54
        .area   _GSINIT
55
        .area   _GSFINAL
56
 
57
        .area   _DATA
58
        .area   _BSS
59
        .area   _HEAP
60
 
61
        .area   _CODE
62
__clock::
63
        ld      a,#2
64
        rst     0x08
65
        ret
66
 
67
_exit::
68
        ;; Exit - special code to the emulator
69
        ld      a,#0
70
        rst     0x08
71
1$:
72
        halt
73
        jr      1$
74
 
75
        .area   _GSINIT
76
gsinit::
77
 
78
        .area   _GSFINAL
79
        ret

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.