Copies a bunch of bytes from one place in memory to other.
void cpct_memcpy (void* to, const void* from, u16 size);
(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
11 bytes
Case | Cycles | microSecs (us) ----------------------------------------- Any | 89 + 21*S | 22.25 + 5.25*S ----------------------------------------- Asm saving | -84 | -21.00 -----------------------------------------
S = size (Number of total bytes to set)