Initial revision
[fw/sdcc] / device / lib / small / _strstr.asm
1 ;--------------------------------------------------------
2 ; File Created by SDCC : FreeWare ANSI-C Compiler
3 ; Version 2.1.9Ga Sun Jan 16 17:31:17 2000
4
5 ;--------------------------------------------------------
6         .module _strstr
7 ;--------------------------------------------------------
8 ; publics variables in this module
9 ;--------------------------------------------------------
10         .globl _strstr_PARM_2
11         .globl _strstr
12 ;--------------------------------------------------------
13 ; special function registers
14 ;--------------------------------------------------------
15 ;--------------------------------------------------------
16 ; special function bits 
17 ;--------------------------------------------------------
18 ;--------------------------------------------------------
19 ; internal ram data
20 ;--------------------------------------------------------
21         .area   DSEG    (DATA)
22 ;--------------------------------------------------------
23 ; overlayable items in internal ram 
24 ;--------------------------------------------------------
25         .area _DUMMY
26         .area   OSEG    (OVR,DATA)
27 _strstr_PARM_2:
28         .ds     0x0003
29 _strstr_cp_1_1:
30         .ds     0x0003
31 _strstr_s1_1_1:
32         .ds     0x0003
33 _strstr_s2_1_1:
34         .ds     0x0003
35 ;--------------------------------------------------------
36 ; indirectly addressable internal ram data
37 ;--------------------------------------------------------
38         .area   ISEG    (DATA)
39 ;--------------------------------------------------------
40 ; bit data
41 ;--------------------------------------------------------
42         .area   BSEG    (BIT)
43 ;--------------------------------------------------------
44 ; external ram data
45 ;--------------------------------------------------------
46         .area   XSEG    (XDATA)
47 ;--------------------------------------------------------
48 ; global & static initialisations
49 ;--------------------------------------------------------
50         .area GSINIT (CODE)
51 ;--------------------------------------------------------
52 ; code
53 ;--------------------------------------------------------
54         .area CSEG (CODE)
55         G$strstr$0$0 ==.
56 ;       _strstr.c 27
57 ;       -----------------------------------------
58 ;        function strstr
59 ;       -----------------------------------------
60 _strstr:
61         ar2 = 0x02
62         ar3 = 0x03
63         ar4 = 0x04
64         ar5 = 0x05
65         ar6 = 0x06
66         ar7 = 0x07
67         ar0 = 0x00
68         ar1 = 0x01
69 ;       _strstr.c 0
70         mov     r2,dpl
71         mov     r3,dph
72         mov     r4,b
73 ;       _strstr.c 32
74         mov     _strstr_cp_1_1,r2
75         mov     (_strstr_cp_1_1 + 1),r3
76         mov     (_strstr_cp_1_1 + 2),r4
77 ;       _strstr.c 36
78         mov     _strstr_s2_1_1,_strstr_PARM_2
79         mov     (_strstr_s2_1_1 + 1),(_strstr_PARM_2 + 1)
80         mov     (_strstr_s2_1_1 + 2),(_strstr_PARM_2 + 2)
81         mov     dpl,_strstr_s2_1_1
82         mov     dph,(_strstr_s2_1_1 + 1)
83         mov     b,(_strstr_s2_1_1 + 2)
84         lcall   __gptrget
85 ; Peephole 105   removed redundant mov
86         mov  r6,a
87 ; Peephole 109   removed ljmp by inverse jump logic
88         jnz  00122$
89 00123$:
90 ;       _strstr.c 37
91         mov     dpl,r2
92         mov     dph,r3
93         mov     b,r4
94         ljmp    00113$
95 ;       _strstr.c 39
96 00122$:
97 00110$:
98         mov     dpl,r2
99         mov     dph,r3
100         mov     b,r4
101         lcall   __gptrget
102 ; Peephole 105   removed redundant mov
103         mov  r6,a
104         jnz     00124$
105         ljmp    00112$
106 00124$:
107 ;       _strstr.c 42
108 ;       _strstr.c 44
109         mov     _strstr_s1_1_1,r2
110         mov     (_strstr_s1_1_1 + 1),r3
111         mov     (_strstr_s1_1_1 + 2),r4
112         mov     r0,_strstr_s2_1_1
113         mov     r1,(_strstr_s2_1_1 + 1)
114         mov     r5,(_strstr_s2_1_1 + 2)
115 00105$:
116         mov     dpl,_strstr_s1_1_1
117         mov     dph,(_strstr_s1_1_1 + 1)
118         mov     b,(_strstr_s1_1_1 + 2)
119         lcall   __gptrget
120 ; Peephole 105   removed redundant mov
121         mov  r6,a
122 ; Peephole 110   removed ljmp by inverse jump logic
123         jz  00107$
124 00125$:
125         mov     dpl,r0
126         mov     dph,r1
127         mov     b,r5
128         lcall   __gptrget
129 ; Peephole 105   removed redundant mov
130         mov  r7,a
131 ; Peephole 110   removed ljmp by inverse jump logic
132         jz  00107$
133 00126$:
134         clr     c
135         mov     a,r6
136         subb    a,r7
137 ; Peephole 109   removed ljmp by inverse jump logic
138         jnz  00107$
139 00127$:
140 ;       _strstr.c 45
141         inc     _strstr_s1_1_1
142         clr     a
143         cjne    a,_strstr_s1_1_1,00128$
144         inc     (_strstr_s1_1_1 + 1)
145 00128$:
146         inc     r0
147         cjne    r0,#0x00,00129$
148         inc     r1
149 00129$:
150 ; Peephole 132   changed ljmp to sjmp
151         sjmp 00105$
152 00107$:
153 ;       _strstr.c 47
154         mov     dpl,r0
155         mov     dph,r1
156         mov     b,r5
157         lcall   __gptrget
158 ; Peephole 105   removed redundant mov
159         mov  r0,a
160 ; Peephole 109   removed ljmp by inverse jump logic
161         jnz  00109$
162 00130$:
163 ;       _strstr.c 48
164         mov     dpl,_strstr_cp_1_1
165         mov     dph,(_strstr_cp_1_1 + 1)
166         mov     b,(_strstr_cp_1_1 + 2)
167 ; Peephole 132   changed ljmp to sjmp
168         sjmp 00113$
169 00109$:
170 ;       _strstr.c 50
171         inc     r2
172         cjne    r2,#0x00,00131$
173         inc     r3
174 00131$:
175         mov     _strstr_cp_1_1,r2
176         mov     (_strstr_cp_1_1 + 1),r3
177         mov     (_strstr_cp_1_1 + 2),r4
178         ljmp    00110$
179 00112$:
180 ;       _strstr.c 53
181 ; Peephole 181   used 16 bit load of dptr
182         mov  dptr,#0x0000
183         mov     b,#0x00
184 00113$:
185         C$_strstr.c$54$1$1 ==.
186         XG$strstr$0$0 ==.
187         ret
188         .area   CSEG    (CODE)