| Purpose: | Copy a block of data from one SRAM memory location to another SRAM location. This subroutine determines the "direction" to copy, so overlapping data ranges are handled correctly (i.e., so characters are not overwritten and lost while copying.) | |||
| Assumes: | bPtrTo and bPtrFrom are valid. | |||
| Passed: | R25:R24 | BYTE * | bPtrTo | the SRAM destination address |
| R23:R22 | BYTE * | bPtrFrom | the SRAM source address | |
| R21:R20 | WORD | wCount | number of BYTEs to copy | |
| Returns: | R25:R24 | BYTE * | bPtrStart | the caller's bPtrTo value (unmodified) |
| Alters: | The memory block referenced and the FLAGs | |||
| Example: | Sometimes it is desired to make some room in a buffer in order to modify a command before passing it to the CommandParser() routine. |
| |
| Notes: | The bPtrTo and bPtrFrom values are not checked for validity. |
| The wCount value is limited to 2,047 (= 0x7FF) BYTEs. | |
| If wCount is zero, it exits immediately with no SRAM change. | |
| Dropin: (setup code) |
; Setup for the memcpy() call: ; Passed: R25:R24 BYTE * bPtrTo pointer to the SRAM destination buffer ; R23:R22 BYTE * bPtrFrom pointer to the SRAM source buffer ; R21:R20 WORD wCount number of BYTEs to copy ; Returns: R25:R24 BYTE * the caller's bPtrTo value (unmodified) ; Alters: The memory block referenced and the FLAGSs |
| Also see: | The strcpy, meminit, and memcpyEEPROM System Functions and the EIS (in Edit) System Command. |