2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 31.05.1998
|
|
|
|
;
|
|
|
|
; char* strcpy (char* dest, const char* src);
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export _strcpy
|
|
|
|
.import popax
|
|
|
|
.importzp ptr1, ptr2
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
_strcpy:
|
2013-05-09 11:56:54 +00:00
|
|
|
sta ptr1 ; Save src
|
|
|
|
stx ptr1+1
|
|
|
|
jsr popax ; Get dest
|
|
|
|
sta ptr2
|
|
|
|
stx ptr2+1
|
|
|
|
ldy #$00
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
L1: lda (ptr1),y
|
|
|
|
sta (ptr2),y
|
|
|
|
beq L9
|
|
|
|
iny
|
|
|
|
bne L1
|
|
|
|
inc ptr1+1
|
|
|
|
inc ptr2+1
|
|
|
|
bne L1
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
L9: lda ptr2 ; X still contains high byte
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
|