]> git.sur5r.net Git - cc65/commitdiff
use tii instead of copy loop to copy data section to ram 222/head
authormrdudz <mrdudz@users.noreply.github.com>
Thu, 22 Oct 2015 17:48:21 +0000 (19:48 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Thu, 22 Oct 2015 17:48:21 +0000 (19:48 +0200)
libsrc/pce/crt0.s

index 77872f32fc3dd0add639ff5e76677bba74dca46b..e92e9eca336f057d3fe198f06bb0788a9bc2882c 100644 (file)
@@ -96,43 +96,7 @@ start:
         jsr     zerobss
 
         ; Copy the .data segment to RAM
-        lda     #<(__DATA_LOAD__)
-        sta     ptr1
-        lda     #>(__DATA_LOAD__)
-        sta     ptr1+1
-        lda     #<(__DATA_RUN__)
-        sta     ptr2
-        lda     #>(__DATA_RUN__)
-        sta     ptr2+1
-
-        ldx     #>(__DATA_SIZE__)
-@l2:
-        beq     @s1             ; no more full pages
-
-        ; copy one page
-        ldy     #0
-@l1:
-        lda     (ptr1),y
-        sta     (ptr2),y
-        iny
-        bne     @l1
-
-        inc     ptr1+1
-        inc     ptr2+1
-
-        dex
-        bne     @l2
-
-        ; copy remaining bytes
-@s1:
-        ; copy one page
-        ldy     #0
-@l3:
-        lda     (ptr1),y
-        sta     (ptr2),y
-        iny
-        cpy     #<(__DATA_SIZE__)
-        bne     @l3
+        tii     __DATA_LOAD__, __DATA_RUN__, __DATA_SIZE__
 
         ; setup the stack
         lda     #<(__RAM_START__+__RAM_SIZE__)