| Example: |
Insert4Spaces:
MOVW R24, R26 ; To make room at the start of a buffered string,
ADIW R24, 4 ; set the destination pointer higher in memory
MOVW R22, R26 ; Leave the source pointer where it was originally
CALL Astrcpy ; OK, we're good to go; copy the string
LDI R21, ' '
ST X+, R21
ST X+, R21 ; Replace those first four (4) bytes with spaces
ST X+, R21
ST X+, R21
RET |
Dropin: (setup code) |
; Setup for the strcpy() call:
; Passed: R25:R24 CHAR * szPtrTo pointer to the SRAM destination buffer
; R23:R22 CHAR * szPtrFrom pointer to the SRAM source buffer
; Returns: R25:R24 CHAR * the caller's szPtrTo value (unmodified)
; Alters: R21, the destination memory block, and the FLAGSs
|