1
/* Copyright (c) 2006, Carlos Lamas
3
based on libc/pmstring/strcpy_P.S which is
4
Copyright (c) 2002, Marek Michalkiewicz
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions are met:
11
* Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
* Redistributions in binary form must reproduce the above copyright
14
notice, this list of conditions and the following disclaimer in
15
the documentation and/or other materials provided with the
17
* Neither the name of the copyright holders nor the names of
18
contributors may be used to endorse or promote products derived
19
from this software without specific prior written permission.
21
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
POSSIBILITY OF SUCH DAMAGE. */
33
/* $Id: strcpy_PF.S 2191 2010-11-05 13:45:57Z arcanum $ */
35
#if !defined(__AVR_TINY__)
46
/** \ingroup avr_pgmspace
47
\fn char *strcpy_PF (char *dst, uint_farptr_t src)
48
\brief Duplicate a string
50
The strcpy_PF() function is similar to strcpy() except that \e src is a far
51
pointer to a string in program space
53
\param dst A pointer to the destination string in SRAM
54
\param src A far pointer to the source string in Flash
56
\returns The strcpy_PF() function returns a pointer to the destination
57
string \e dst. The contents of RAMPZ SFR are undefined when the funcion
60
#if !defined(__DOXYGEN__)
64
.type _U(strcpy_PF), @function
69
LPM_R0_ZPLUS_INIT src_b2
74
LPM_R0_ZPLUS_NEXT src_b2
77
brne .L_strcpy_PF_loop
79
; return dest (unchanged)
85
.size _U(strcpy_PF), .L_strcpy_PF_end - _U(strcpy_PF)
87
#endif /* not __DOXYGEN__ */
89
#endif /* !defined(__AVR_TINY__) */