| 33 |
Created by Reiner Patommel |
Created by Reiner Patommel |
| 34 |
*/ |
*/ |
| 35 |
|
|
| 36 |
|
/* $Id$ */ |
| 37 |
|
|
| 38 |
#include "macros.inc" |
#include "macros.inc" |
| 39 |
|
|
| 40 |
#define dest_hi r25 |
#define dest_hi r25 |
| 57 |
.global _U(strcat_P) |
.global _U(strcat_P) |
| 58 |
.type _U(strcat_P), @function |
.type _U(strcat_P), @function |
| 59 |
_U(strcat_P): |
_U(strcat_P): |
| 60 |
LOAD_Z(src_lo, src_hi) |
X_movw ZL, src_lo |
| 61 |
LOAD_X(dest_lo, dest_hi) |
X_movw XL, dest_lo |
| 62 |
.strcat_P_skip: |
.L_strcat_P_skip: |
| 63 |
ld __tmp_reg__, X+ |
ld __tmp_reg__, X+ |
| 64 |
tst __tmp_reg__ |
tst __tmp_reg__ |
| 65 |
brne .strcat_P_skip |
brne .L_strcat_P_skip |
| 66 |
sbiw XL, 1 ; undo post-increment |
sbiw XL, 1 ; undo post-increment |
| 67 |
.strcat_P_loop: |
.L_strcat_P_loop: |
| 68 |
LPM_R0_ZP |
LPM_R0_ZP |
| 69 |
st X+, r0 |
st X+, r0 |
| 70 |
tst r0 |
tst r0 |
| 71 |
brne .strcat_P_loop |
brne .L_strcat_P_loop |
| 72 |
; return dest (unchanged) |
; return dest (unchanged) |
| 73 |
ret |
ret |
| 74 |
.strcat_P_end: |
.L_strcat_P_end: |
| 75 |
.size _U(strcat_P), .strcat_P_end - _U(strcat_P) |
.size _U(strcat_P), .L_strcat_P_end - _U(strcat_P) |
| 76 |
|
|
| 77 |
#endif /* not DOXYGEN */ |
#endif /* not DOXYGEN */ |