]> git.sur5r.net Git - cc65/commitdiff
memmove, memcpy, memset and bzero now return dest ptr as they should
authorizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 21 Dec 2002 00:49:25 +0000 (00:49 +0000)
committerizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 21 Dec 2002 00:49:25 +0000 (00:49 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1815 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/geos/common/memset.s
libsrc/geos/memory/movedata.s

index 74005b0e90babd61ff33ccd9a717b3b5acd58a96..1a98c1c3473dccf979e6d8f16a05a41ce2a23a2e 100644 (file)
@@ -34,8 +34,12 @@ _memset:
            sta r2L
 common:            jsr popax
            sta r1L
+           pha
            stx r1H
+           txa
+           pha
            jsr FillRam
-           lda r1L             ; restore ptr and pass as result
-           ldx r1H
+           pla                 ; restore ptr and return it
+           tax
+           pla
            rts
index b16ef2392dbd86ff41b5bc78f0d42ffc77738351..5391e95c5115f193ad8c689fcd8fd6dd57933640 100644 (file)
@@ -4,7 +4,7 @@
 ;
 ; 30.10.99, 15.07.2001
 
-; void MoveData         (char* dest, char *source, int length);
+; void* MoveData         (char* dest, char *source, int length);
 
            .import popax
            .export _MoveData
@@ -21,4 +21,7 @@ _MoveData:
            jsr popax
            sta r1L
            stx r1H
-           jmp MoveData
+           jsr MoveData
+           lda r1L             ; return dest ptr to be compatible with memmove and memcpy
+           ldx r1H
+           rts