2686711ae96e2f69eca88c5745b323b2cb0ef0d3
[fw/sdcc] / support / regression / ports / z80 / support.asm
1         ;; ****************************************
2         ;; Minimal crt0 and support functions for the sdcc test suite.
3         ;; Beginning of module
4         .title  "Test runtime"
5         .module Runtime
6
7         .globl _main
8         .STACK = 0xE000
9
10         .area   _INIT (ABS)
11         .org    0x0
12         jp      0x100
13                                 
14         .org    0x100
15 __init::
16         ;; Beginning of the code
17         DI                      ; Disable interrupts
18         LD      SP,#.STACK
19         ;; Call the main function
20         CALL    _main
21         ld      a, #0
22         rst     8
23
24 __putchar::
25         ld      a,#1
26         rst     #8
27         ret
28
29         ;; Segment order
30         .org    0x200
31         .area _HOME
32         .area _CODE
33         .area _OVERLAY
34         .area _ISEG
35         .area _BSEG
36         .area _XSEG
37         .area _GSINIT
38         .area _GSFINAL
39         .area _GSINIT
40         .area _CODE
41
42         .area _DATA