Skip to content

Commit

Permalink
[libc] add memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Nov 21, 2024
1 parent 2c64cab commit 630537d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
28 changes: 28 additions & 0 deletions src/libc/memcpy.src
Original file line number Diff line number Diff line change
@@ -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


2 changes: 0 additions & 2 deletions src/libc/os.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ _longjmp := 000098h
_memchr := 00009Ch
public _memcmp
_memcmp := 0000A0h
public _memcpy
_memcpy := 0000A4h
public _memmove
_memmove := 0000A8h
public _setjmp
Expand Down

0 comments on commit 630537d

Please sign in to comment.