1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-06 01:55:47 +00:00

memmove, memcpy, memset and bzero now return dest ptr as they should

git-svn-id: svn://svn.cc65.org/cc65/trunk@1815 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2002-12-21 00:49:25 +00:00
parent 9227123e16
commit a63a1075f8
2 changed files with 11 additions and 4 deletions

View File

@ -34,8 +34,12 @@ _memset:
sta r2L sta r2L
common: jsr popax common: jsr popax
sta r1L sta r1L
pha
stx r1H stx r1H
txa
pha
jsr FillRam jsr FillRam
lda r1L ; restore ptr and pass as result pla ; restore ptr and return it
ldx r1H tax
pla
rts rts

View File

@ -4,7 +4,7 @@
; ;
; 30.10.99, 15.07.2001 ; 30.10.99, 15.07.2001
; void MoveData (char* dest, char *source, int length); ; void* MoveData (char* dest, char *source, int length);
.import popax .import popax
.export _MoveData .export _MoveData
@ -21,4 +21,7 @@ _MoveData:
jsr popax jsr popax
sta r1L sta r1L
stx r1H stx r1H
jmp MoveData jsr MoveData
lda r1L ; return dest ptr to be compatible with memmove and memcpy
ldx r1H
rts