1{
2    This file is part of the Free Pascal run time library.
3    Copyright (c) 1999-2000 by Jonas Maebe, member of the
4    Free Pascal development team
5
6    Processor dependent part of strings.pp, not shared with
7    sysutils unit.
8
9    See the file COPYING.FPC, included in this distribution,
10    for details about the copyright.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
16 **********************************************************************}
17
18{$ifndef FPC_UNIT_HAS_STRPCOPY}
19{$define FPC_UNIT_HAS_STRPCOPY}
20function strpcopy(d : pchar;const s : string) : pchar;assembler;
21asm
22        { get length  }
23        lbz     r0,0(r4)
24        { put in counter }
25        cmplwi  r0,0
26        mtctr   r0
27        subi    r10,r3,1
28        beq     .LStrPCopyEmpty
29.LStrPCopyLoop:
30        { copy everything }
31        lbzu    r0,1(r4)
32        stbu    r0,1(r10)
33        bdnz    .LStrPCopyLoop
34        { add terminating #0 }
35        li      r0,0
36.LStrPCopyEmpty:
37        stb     r0,1(r10)
38end;
39{$endif FPC_UNIT_HAS_STRPCOPY}
40
41