You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
400 B
ArmAsm
31 lines
400 B
ArmAsm
;
|
|
; Ullrich von Bassewitz, 31.05.1998
|
|
;
|
|
; char* strcpy (char* dest, const char* src);
|
|
;
|
|
|
|
.export _strcpy
|
|
.import popax
|
|
.importzp ptr1, ptr2
|
|
|
|
_strcpy:
|
|
sta ptr1 ; Save src
|
|
stx ptr1+1
|
|
jsr popax ; Get dest
|
|
sta ptr2
|
|
stx ptr2+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 ptr2 ; X still contains high byte
|
|
rts
|
|
|