~ubuntu-branches/ubuntu/breezy/avr-libc/breezy

« back to all changes in this revision

Viewing changes to libc/pmstring/strcpy_P.S

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2002-04-15 14:53:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020415145338-c8hi0tn5bx74w7o3
Tags: upstream-20020203
ImportĀ upstreamĀ versionĀ 20020203

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include "macros.inc"
 
3
 
 
4
#define dest_hi r25
 
5
#define dest_lo r24
 
6
#define src_hi r23
 
7
#define src_lo r22
 
8
 
 
9
; char *strcpy_P(char *dest, const char flash *src)
 
10
; 10 words, (17 + strlen_P(src) * 10) cycles
 
11
 
 
12
        .text
 
13
        .global _U(strcpy_P)
 
14
        .type   _U(strcpy_P), @function
 
15
_U(strcpy_P):
 
16
        LOAD_Z(src_lo, src_hi)
 
17
        LOAD_X(dest_lo, dest_hi)
 
18
.strcpy_P_loop:
 
19
        LPM_R0_ZP
 
20
        st      X+, r0
 
21
        tst     r0
 
22
        brne    .strcpy_P_loop
 
23
; return dest (unchanged)
 
24
        ret
 
25
.strcpy_P_end:
 
26
        .size   _U(strcpy_P), .strcpy_P_end - _U(strcpy_P)
 
27