]> git.sur5r.net Git - cc65/blobdiff - libsrc/common/zerobss.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / common / zerobss.s
index 9e1d005248e2997e01d9fcb53f0e88f775283cf3..321424efac8ab86d6a764d17a7688a7f3f3b19c2 100644 (file)
@@ -1,5 +1,5 @@
 ;
-; Ullrich von Bassewitz, 17.09.1998
+; Ullrich von Bassewitz, 1998-09-17, 2005-02-26.
 ;
 ; Zero the bss segment.
 ;
@@ -9,7 +9,7 @@
        .importzp       ptr1
 
 
-.code
+.segment "INIT"
 
 zerobss:
        lda     #<__BSS_RUN__
@@ -32,16 +32,15 @@ L2: sta     (ptr1),y
 
 ; Clear remaining page (y is zero on entry)
 
-L3:    ldx     #<__BSS_SIZE__
-       beq     L5
-L4:    sta     (ptr1),y
-       iny
-       dex
-       bne     L4
+L3:    cpy     #<__BSS_SIZE__
+       beq     L4
+       sta     (ptr1),y
+       iny
+       bne     L3
 
 ; Done
 
-L5:    rts
+L4:    rts