Important: The information in this document is obsolete and should not be used for new development.
BlockMove
To copy a sequence of bytes from one location in memory to another, you can use theBlockMove
procedure.
PROCEDURE BlockMove (sourcePtr, destPtr: Ptr; byteCount: Size);
sourcePtr
- The address of the first byte to copy.
destPtr
- The address of the first byte to copy to.
byteCount
- The number of bytes to copy. If the value of
byteCount
is 0,BlockMove
does nothing.DESCRIPTION
TheBlockMove
procedure moves a block ofbyteCount
consecutive bytes from
the address designated bysourcePtr
to that designated bydestPtr
. It updates
no pointers.The
BlockMove
procedure works correctly even if the source and destination
blocks overlap.SPECIAL CONSIDERATIONS
You can safely callBlockMove
at interrupt time. Even though it moves memory,BlockMove
does not move relocatable blocks, but simply copies bytes.The
BlockMove
procedure currently flushes the processor caches whenever the number of bytes to be moved is greater than 12. This behavior can adversely affect your application's performance. You might want to avoid callingBlockMove
to move small amounts of data in memory if there is no possibility of moving stale data or instructions. For more information about stale data and instructions, see the discussion of the processor caches in the chapter "Memory Management Utilities" in this book.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forBlockMove
are
Registers on entry A0 Pointer to source A1 Pointer to destination D0 Number of bytes to copy
Registers on exit D0 Result code RESULT CODE
noErr 0 No error