Copies a bunch of bytes from one place in memory to other.
void cpct_memcpy (void* to, const void* from, u16 size) __z88dk_callee;
(2B DE) to | Pointer to the destination (first byte where bytes will be written) |
(2B HL) from | Pointer to the source (first byte from which bytes will be read) |
(2B BC) size | Number of bytes to be set (>= 1) |
call cpct_memcpy_asm
Copies a size bytes from one location to other in memory. This function is an specific implementation of standard C memcpy for Z80 machines, and it is fully compatible with the standard.
AF, BC, DE, HL
C-bindings | 8 bytes |
ASM-bindings | 3 bytes |
Case | microSecs (us) | CPU Cycles ----------------------------------------- Any | 18 + 6S | 72 + 24S ----------------------------------------- Asm saving | -16 | -64 -----------------------------------------
S = size (Number of total bytes to set)