memcopy
This commit is contained in:
parent
ae17478c14
commit
15865cab9c
22
programs/memcopy.s65
Normal file
22
programs/memcopy.s65
Normal file
@ -0,0 +1,22 @@
|
||||
.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
|
||||
lda (ARG0,y)
|
||||
sta (ARG2,y)
|
||||
dey
|
||||
bra @loop
|
||||
loop_end:
|
||||
rts
|
||||
.endif ; guard
|
||||
|
Loading…
Reference in New Issue
Block a user