mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / strings / strxmov-sparc.s
blobbf0df11ffc796532687b1ffa37ac85140072c6ba
1 ! Copyright (c) 2000, 2002, 2006 MySQL AB
2 !
3 ! This library is free software; you can redistribute it and/or
4 ! modify it under the terms of the GNU Library General Public
5 ! License as published by the Free Software Foundation; version 2
6 ! of the License.
7 !
8 ! This library is distributed in the hope that it will be useful,
9 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ! Library General Public License for more details.
13 ! You should have received a copy of the GNU Library General Public
14 ! License along with this library; if not, write to the Free
15 ! Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 ! MA 02110-1301, USA
19 ! Note that this function only works on 32 bit sparc systems
20 ! on 64 bits the offsets to %sp are different !
22 .file "strxmov-sparc.s"
23 .section ".text"
24 .align 4
25 .global strxmov
26 .type strxmov,#function
27 .proc 0102
29 strxmov:
30 st %o2, [%sp+76] ! store 3rd param before other params
31 st %o3, [%sp+80] ! store 4th param " "
32 cmp %o1, 0 ! check if no from args
33 st %o4, [%sp+84] ! store 5th param
34 be .end
35 st %o5, [%sp+88] ! store last
36 add %sp, 76, %o4 ! put pointer to 3rd arg
37 .loop:
38 ldub [%o1], %o5 ! set values of src (o1)
39 add %o1, 1, %o1 ! inc src
40 stb %o5, [%o0] ! and dst (o2) equal
41 cmp %o5, 0 ! second while cmp
42 bne,a .loop
43 add %o0, 1, %o0 ! inc dst
44 ld [%o4], %o1 ! get next param
45 cmp %o1, 0 ! check if last param
46 bne .loop
47 add %o4, 4, %o4 ! advance to next param
48 .end:
49 retl
50 stb %g0, [%o0]
51 .strxmov_end:
52 .size strxmov,.strxmov_end-strxmov
53 .ident "Matt Wagner & Monty"