This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
33
libsrc/common/strcpy.s
Normal file
33
libsrc/common/strcpy.s
Normal file
@@ -0,0 +1,33 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 31.05.1998
|
||||
;
|
||||
; char* strcpy (char* dest, const char* src);
|
||||
;
|
||||
|
||||
.export _strcpy
|
||||
.import popax
|
||||
.importzp ptr1, ptr2, ptr3
|
||||
|
||||
_strcpy:
|
||||
sta ptr1 ; Save src
|
||||
stx ptr1+1
|
||||
jsr popax ; Get dest
|
||||
sta ptr2
|
||||
stx ptr2+1
|
||||
sta ptr3 ; remember for function return
|
||||
stx ptr3+1
|
||||
ldy #$00
|
||||
|
||||
L1: lda (ptr1),y
|
||||
sta (ptr2),y
|
||||
beq L9
|
||||
iny
|
||||
bne L1
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
bne L1
|
||||
|
||||
L9: lda ptr3
|
||||
ldx ptr3+1
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user