/[avr-libc]/avr-libc/libc/pmstring/strnlen_P.S
ViewVC logotype

Diff of /avr-libc/libc/pmstring/strnlen_P.S

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by aesok, Mon Sep 26 17:22:08 2005 UTC revision 1.4 by aesok, Tue Nov 8 16:19:51 2005 UTC
# Line 56  Line 56 
56          .global _U(strnlen_P)          .global _U(strnlen_P)
57          .type   _U(strnlen_P), @function          .type   _U(strnlen_P), @function
58  _U(strnlen_P):  _U(strnlen_P):
59          LOAD_Z(src_lo, src_hi)          X_movw  ZL, src_lo
60  1:  .L_strnlen_P_loop:
61          LPM_R0_ZP          LPM_R0_ZP
62          subi    len_lo, lo8(1)          subi    len_lo, lo8(1)
63          sbci    len_hi, hi8(1)          sbci    len_hi, hi8(1)
64          cpse    r0, __zero_reg__          cpse    r0, __zero_reg__
65          brcc    1b          brcc    .L_strnlen_P_loop
66  ; Z points one character past the terminating NUL  ; Z points one character past the terminating NUL
67  ; return Z - 1 - src = (-1 - src) + Z = ~src + Z  ; return Z - 1 - src = (-1 - src) + Z = ~src + Z
68          com     src_lo          com     src_lo
# Line 70  _U(strnlen_P): Line 70  _U(strnlen_P):
70          add     src_lo, ZL          add     src_lo, ZL
71          adc     src_hi, ZH          adc     src_hi, ZH
72          ret          ret
73  .Lstrnlen_P_end:  .L_strnlen_P_end:
74          .size   _U(strnlen_P), .Lstrnlen_P_end - _U(strnlen_P)          .size   _U(strnlen_P), .L_strnlen_P_end - _U(strnlen_P)
75    
76  #endif /* not __DOXYGEN__ */  #endif /* not __DOXYGEN__ */

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26