From 15865cab9c26105c86e597fe833b2e6350a09fbd Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Fri, 10 Nov 2023 00:55:03 +0100 Subject: [PATCH] memcopy --- programs/memcopy.s65 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 programs/memcopy.s65 diff --git a/programs/memcopy.s65 b/programs/memcopy.s65 new file mode 100644 index 0000000..76b4cd4 --- /dev/null +++ b/programs/memcopy.s65 @@ -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 +