Applied patch #2762516
[fw/sdcc] / device / lib / z80 / crt0.s
index c05ae1d18d31d2a1e1cf98556c0a9f7ec2eebc17..7ff5fa43da945aac9e9ca5ab520ef370fc0acb91 100644 (file)
@@ -1,7 +1,8 @@
        ;; Generic crt0.s for a Z80
-       .globl  _main
+        .module crt0
+               .globl  _main
 
-       .area _HEADER (ABS)
+       .area   _HEADER (ABS)
        ;; Reset vector
        .org    0
        jp      init
        reti
        .org    0x38
        reti
-       
+
        .org    0x100
 init:
        ;; Stack at the top of memory.
-       ld      sp,#0xffff        
+       ld      sp,#0xffff
 
         ;; Initialise global variables
         call    gsinit
@@ -32,28 +33,20 @@ init:
        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
-       
-_getsp::
-       ld      hl,#0
-       add     hl,sp
-       ret
-
-__printTStates::       
-       ld      a,#3
-       out     (0xff),a
-       ret
 
 _exit::
        ;; Exit - special code to the emulator
@@ -64,7 +57,7 @@ _exit::
        jr      1$
 
         .area   _GSINIT
-gsinit::       
+gsinit::
 
         .area   _GSFINAL
         ret