diff --git a/src/libc/memcpy.src b/src/libc/memcpy.src new file mode 100644 index 000000000..ad836658a --- /dev/null +++ b/src/libc/memcpy.src @@ -0,0 +1,28 @@ + assume adl=1 + + section .text + public _memcpy + +if PREFER_OS_LIBC + +_memcpy := $0000A4 + +else + +_memcpy: + ld iy,0 + add iy,sp + ld bc,(iy + 6) + sbc hl,hl + sbc hl,bc + jr z,.zero + ld de,(iy + 0) + ld hl,(iy + 3) + ldir +.zero: + ld hl,(iy + 0) + ret + +end if + + diff --git a/src/libc/os.src b/src/libc/os.src index f6b527a8e..09ce92ecb 100644 --- a/src/libc/os.src +++ b/src/libc/os.src @@ -8,8 +8,6 @@ _longjmp := 000098h _memchr := 00009Ch public _memcmp _memcmp := 0000A0h - public _memcpy -_memcpy := 0000A4h public _memmove _memmove := 0000A8h public _setjmp