]> git.sur5r.net Git - cc65/commitdiff
Fixed a bug in memcpy
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 22 Oct 2003 21:04:22 +0000 (21:04 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 22 Oct 2003 21:04:22 +0000 (21:04 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2562 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/common/memcpy.s

index b61b82c1f68e4e1465aad89de080f8c720466af5..ff2c4bdde0fabcea0eddaaf57c7e5fc77bd024d8 100644 (file)
@@ -23,16 +23,16 @@ memcpy_upwards:
 ; Copy loop
 
 @L1:    inx                     ; Bump low counter byte
-        beq     @L2             ; Jump on overflow
-        lda     (ptr1),y
+        beq     @L3             ; Jump on overflow
+@L2:    lda     (ptr1),y
         sta     (ptr2),y
         iny
         bne     @L1
                inc     ptr1+1          ; Bump pointers
                inc     ptr2+1
         bne     @L1             ; Branch always
-@L2:    inc     ptr3+1          ; Bump high counter byte
-        bne     @L1
+@L3:    inc     ptr3+1          ; Bump high counter byte
+        bne     @L2
 
 ; Done. The low byte of dest is still in ptr2