6502-OS/programs/memcopy.s65

23 lines
505 B
Plaintext
Raw Normal View History

2023-11-10 00:55:03 +01:00
.ifndef INCLUDE_MEMCOPY
INCLUDE_MEMCOPY = 1
;********************************************************************************
; @function Copy a block of memory to a different address
; @param ARG0-1: Source address
; @param ARG2-3: Target address
; @param y: Number of bytes to copy
;********************************************************************************
.proc memcopy
cpy
loop:
beq @loop_end
2023-12-08 00:03:29 +01:00
lda (ARG0),y
sta (ARG2),y
2023-11-10 00:55:03 +01:00
dey
bra @loop
loop_end:
rts
.endif ; guard