RosettaCodeData/Task/Deepcopy/6502-Assembly/deepcopy-3.6502
2023-07-01 13:44:08 -04:00

14 lines
284 B
Text

;input:
;$00,$01 = pointer to source
;$07,$08 = pointer to destination
;X = bytes to copy
;(the memory addresses are arbitrary, but each pair of input addresses MUST be consecutive or this won't work.)
memcpy:
LDY #0
memcpy_again:
lda ($00),y
sta ($07),y
iny
dex
bne memcpy_again
rts