Initial revision
[fw/sdcc] / device / lib / large / _fs2uint.asm
1 ;--------------------------------------------------------
2 ; File Created by SDCC : FreeWare ANSI-C Compiler
3 ; Version 2.1.9Ga Sun Jan 16 17:31:24 2000
4
5 ;--------------------------------------------------------
6         .module _fs2uint
7 ;--------------------------------------------------------
8 ; publics variables in this module
9 ;--------------------------------------------------------
10         .globl ___fs2uint
11 ;--------------------------------------------------------
12 ; special function registers
13 ;--------------------------------------------------------
14 ;--------------------------------------------------------
15 ; special function bits 
16 ;--------------------------------------------------------
17 ;--------------------------------------------------------
18 ; internal ram data
19 ;--------------------------------------------------------
20         .area   DSEG    (DATA)
21 ___fs2uint_sloc0_1_0:
22         .ds     0x0004
23 ___fs2uint_sloc1_1_0:
24         .ds     0x0004
25 ;--------------------------------------------------------
26 ; overlayable items in internal ram 
27 ;--------------------------------------------------------
28         .area   OSEG    (OVR,DATA)
29 ;--------------------------------------------------------
30 ; indirectly addressable internal ram data
31 ;--------------------------------------------------------
32         .area   ISEG    (DATA)
33 ;--------------------------------------------------------
34 ; bit data
35 ;--------------------------------------------------------
36         .area   BSEG    (BIT)
37 ;--------------------------------------------------------
38 ; external ram data
39 ;--------------------------------------------------------
40         .area   XSEG    (XDATA)
41 ___fs2uint_a1_1_1:
42         .ds     0x0004
43 ___fs2uint_fl1_1_1:
44         .ds     0x0004
45 ___fs2uint_exp_1_1:
46         .ds     0x0002
47 ___fs2uint_l_1_1:
48         .ds     0x0004
49 ;--------------------------------------------------------
50 ; global & static initialisations
51 ;--------------------------------------------------------
52         .area GSINIT (CODE)
53 ;--------------------------------------------------------
54 ; code
55 ;--------------------------------------------------------
56         .area CSEG (CODE)
57         G$__fs2uint$0$0 ==.
58 ;       _fs2uint.c 73
59 ;       -----------------------------------------
60 ;        function __fs2uint
61 ;       -----------------------------------------
62 ___fs2uint:
63         ar2 = 0x02
64         ar3 = 0x03
65         ar4 = 0x04
66         ar5 = 0x05
67         ar6 = 0x06
68         ar7 = 0x07
69         ar0 = 0x00
70         ar1 = 0x01
71 ;       _fs2uint.c 0
72         push    acc
73         push    b
74         push    dph
75         push    dpl
76         mov     dptr,#___fs2uint_a1_1_1
77         pop     acc
78         movx    @dptr,a
79         pop     acc
80         inc     dptr
81         movx    @dptr,a
82         pop     acc
83         inc     dptr
84         movx    @dptr,a
85         pop     acc
86         inc     dptr
87         movx    @dptr,a
88 ;       _fs2uint.c 79
89         mov     dptr,#___fs2uint_a1_1_1
90         movx    a,@dptr
91         mov     r2,a
92         inc     dptr
93         movx    a,@dptr
94         mov     r3,a
95         inc     dptr
96         movx    a,@dptr
97         mov     r4,a
98         inc     dptr
99         movx    a,@dptr
100         mov     r5,a
101         mov     dptr,#(___fs2uint_fl1_1_1)
102         mov     a,r2
103         movx    @dptr,a
104         inc     dptr
105         mov     a,r3
106         movx    @dptr,a
107         inc     dptr
108         mov     a,r4
109         movx    @dptr,a
110         inc     dptr
111         mov     a,r5
112         movx    @dptr,a
113 ;       _fs2uint.c 81
114         mov     dptr,#(___fs2uint_fl1_1_1)
115         movx    a,@dptr
116         mov     r2,a
117         inc     dptr
118         movx    a,@dptr
119         mov     r3,a
120         inc     dptr
121         movx    a,@dptr
122         mov     r4,a
123         inc     dptr
124         movx    a,@dptr
125         mov     r5,a
126         mov     a,r2
127         orl     a,r3
128         orl     a,r4
129         orl     a,r5
130 ; Peephole 109   removed ljmp by inverse jump logic
131         jnz  00102$
132 00120$:
133 ;       _fs2uint.c 82
134 ; Peephole 181   used 16 bit load of dptr
135         mov  dptr,#0x0000
136         ljmp    00110$
137 00102$:
138 ;       _fs2uint.c 84
139         mov     dptr,#(___fs2uint_fl1_1_1)
140         movx    a,@dptr
141         mov     r2,a
142         inc     dptr
143         movx    a,@dptr
144         mov     r3,a
145         inc     dptr
146         movx    a,@dptr
147         mov     r4,a
148         inc     dptr
149         movx    a,@dptr
150         mov     r5,a
151         mov     ar2,r4
152         mov     a,r5
153         mov     c,acc.7
154         xch     a,r2
155         rlc     a
156         xch     a,r2
157         rlc     a
158         xch     a,r2
159         anl     a,#0x01
160         jnb     acc.0,00121$
161         orl     a,#0xfe
162 00121$:
163         mov     r3,a
164         rlc     a
165         subb    a,acc
166         mov     r4,a
167         mov     r5,a
168         mov     a,r2
169         mov     b,#0x00
170         add     a,#0x6a
171         mov     r2,a
172         mov     a,b
173         addc    a,#0xff
174         mov     r3,a
175         mov     dptr,#___fs2uint_exp_1_1
176         mov     a,r2
177         movx    @dptr,a
178         inc     dptr
179         mov     a,r3
180         movx    @dptr,a
181 ;       _fs2uint.c 85
182         mov     dptr,#(___fs2uint_fl1_1_1)
183         movx    a,@dptr
184         mov     r2,a
185         inc     dptr
186         movx    a,@dptr
187         mov     r3,a
188         inc     dptr
189         movx    a,@dptr
190         mov     r6,a
191         inc     dptr
192         movx    a,@dptr
193         mov     r7,a
194         anl     ar6,#0x7f
195         mov     r7,#0x00
196         mov     dptr,#___fs2uint_l_1_1
197         mov     a,r2
198         movx    @dptr,a
199         inc     dptr
200         mov     a,r3
201         movx    @dptr,a
202         mov     a,#0x80
203         orl     a,r6
204         inc     dptr
205         movx    @dptr,a
206         inc     dptr
207         mov     a,r7
208         movx    @dptr,a
209 ;       _fs2uint.c 87
210         mov     dptr,#___fs2uint_exp_1_1
211         movx    a,@dptr
212         mov     r2,a
213         inc     dptr
214         movx    a,@dptr
215         mov     r3,a
216         clr     c
217 ; Peephole 180   changed mov to clr
218         clr  a
219         subb    a,r2
220 ; Peephole 159   avoided xrl during execution
221         mov  a,#(0x00 ^ 0x80)
222         mov     b,r3
223         xrl     b,#0x80
224         subb    a,b
225 ; Peephole 108   removed ljmp by inverse jump logic
226         jnc  00104$
227 00122$:
228 ;       _fs2uint.c 88
229         mov     dptr,#(___fs2uint_fl1_1_1)
230         movx    a,@dptr
231         mov     r2,a
232         inc     dptr
233         movx    a,@dptr
234         mov     r3,a
235         inc     dptr
236         movx    a,@dptr
237         mov     r6,a
238         inc     dptr
239         movx    a,@dptr
240 ; Peephole 105   removed redundant mov
241         mov  r7,a
242         rl      a
243         anl     a,#0x01
244         mov     r2,a
245         orl     ar2,#0x7f
246         mov     r0,#0x00
247         mov     dpl,r2
248         mov     dph,r0
249         ljmp    00110$
250 00104$:
251 ;       _fs2uint.c 91
252         mov     dptr,#___fs2uint_exp_1_1
253         movx    a,@dptr
254         mov     r2,a
255         inc     dptr
256         movx    a,@dptr
257 ; Peephole 105   removed redundant mov
258         mov  r0,a
259         jb      acc.7,00123$
260         ljmp    00106$
261 00123$:
262         mov     dptr,#___fs2uint_exp_1_1
263         movx    a,@dptr
264         mov     r2,a
265         inc     dptr
266         movx    a,@dptr
267         mov     r0,a
268         clr     c
269         mov     a,#0xe7
270         subb    a,r2
271 ; Peephole 159   avoided xrl during execution
272         mov  a,#(0xff ^ 0x80)
273         mov     b,r0
274         xrl     b,#0x80
275         subb    a,b
276         jc      00124$
277         ljmp    00106$
278 00124$:
279         mov     dptr,#___fs2uint_l_1_1
280         movx    a,@dptr
281         mov     ___fs2uint_sloc0_1_0,a
282         inc     dptr
283         movx    a,@dptr
284         mov     (___fs2uint_sloc0_1_0 + 1),a
285         inc     dptr
286         movx    a,@dptr
287         mov     (___fs2uint_sloc0_1_0 + 2),a
288         inc     dptr
289         movx    a,@dptr
290         mov     (___fs2uint_sloc0_1_0 + 3),a
291         mov     a,___fs2uint_sloc0_1_0
292         orl     a,(___fs2uint_sloc0_1_0 + 1)
293         orl     a,(___fs2uint_sloc0_1_0 + 2)
294         orl     a,(___fs2uint_sloc0_1_0 + 3)
295         jnz     00125$
296         ljmp    00106$
297 00125$:
298 ;       _fs2uint.c 92
299         mov     dptr,#___fs2uint_exp_1_1
300         movx    a,@dptr
301         mov     r2,a
302         inc     dptr
303         movx    a,@dptr
304         mov     r0,a
305         clr     c
306         clr     a
307         subb    a,r2
308         mov     ___fs2uint_sloc0_1_0,a
309         clr     a
310         subb    a,r0
311         mov     (___fs2uint_sloc0_1_0 + 1),a
312         mov     dptr,#___fs2uint_l_1_1
313         movx    a,@dptr
314         mov     ___fs2uint_sloc1_1_0,a
315         inc     dptr
316         movx    a,@dptr
317         mov     (___fs2uint_sloc1_1_0 + 1),a
318         inc     dptr
319         movx    a,@dptr
320         mov     (___fs2uint_sloc1_1_0 + 2),a
321         inc     dptr
322         movx    a,@dptr
323         mov     (___fs2uint_sloc1_1_0 + 3),a
324         mov     b,___fs2uint_sloc0_1_0
325         inc     b
326         mov     a,(___fs2uint_sloc1_1_0 + 3)
327         rlc     a
328         mov     ov,c
329         sjmp    00127$
330 00126$:
331         mov     c,ov
332         mov     a,(___fs2uint_sloc1_1_0 + 3)
333         rrc     a
334         mov     (___fs2uint_sloc1_1_0 + 3),a
335         mov     a,(___fs2uint_sloc1_1_0 + 2)
336         rrc     a
337         mov     (___fs2uint_sloc1_1_0 + 2),a
338         mov     a,(___fs2uint_sloc1_1_0 + 1)
339         rrc     a
340         mov     (___fs2uint_sloc1_1_0 + 1),a
341         mov     a,___fs2uint_sloc1_1_0
342         rrc     a
343         mov     ___fs2uint_sloc1_1_0,a
344 00127$:
345         djnz    b,00126$
346         mov     dptr,#___fs2uint_l_1_1
347         mov     a,___fs2uint_sloc1_1_0
348         movx    @dptr,a
349         inc     dptr
350         mov     a,(___fs2uint_sloc1_1_0 + 1)
351         movx    @dptr,a
352         inc     dptr
353         mov     a,(___fs2uint_sloc1_1_0 + 2)
354         movx    @dptr,a
355         inc     dptr
356         mov     a,(___fs2uint_sloc1_1_0 + 3)
357         movx    @dptr,a
358 ; Peephole 132   changed ljmp to sjmp
359         sjmp 00107$
360 00106$:
361 ;       _fs2uint.c 94
362 ; Peephole 181   used 16 bit load of dptr
363         mov  dptr,#0x0000
364         ljmp    00110$
365 00107$:
366 ;       _fs2uint.c 96
367         mov     dptr,#(___fs2uint_fl1_1_1)
368         movx    a,@dptr
369         mov     ___fs2uint_sloc1_1_0,a
370         inc     dptr
371         movx    a,@dptr
372         mov     (___fs2uint_sloc1_1_0 + 1),a
373         inc     dptr
374         movx    a,@dptr
375         mov     (___fs2uint_sloc1_1_0 + 2),a
376         inc     dptr
377         movx    a,@dptr
378 ; Peephole 105   removed redundant mov
379         mov  (___fs2uint_sloc1_1_0 + 3),a
380         rl      a
381         anl     a,#0x01
382 ; Peephole 105   removed redundant mov
383         mov  r2,a
384 ; Peephole 110   removed ljmp by inverse jump logic
385         jz  00112$
386 00128$:
387         mov     dptr,#___fs2uint_l_1_1
388         movx    a,@dptr
389         mov     ___fs2uint_sloc1_1_0,a
390         inc     dptr
391         movx    a,@dptr
392         mov     (___fs2uint_sloc1_1_0 + 1),a
393         inc     dptr
394         movx    a,@dptr
395         mov     (___fs2uint_sloc1_1_0 + 2),a
396         inc     dptr
397         movx    a,@dptr
398         mov     (___fs2uint_sloc1_1_0 + 3),a
399         clr     c
400         clr     a
401         subb    a,___fs2uint_sloc1_1_0
402         mov     ___fs2uint_sloc1_1_0,a
403         clr     a
404         subb    a,(___fs2uint_sloc1_1_0 + 1)
405         mov     (___fs2uint_sloc1_1_0 + 1),a
406         clr     a
407         subb    a,(___fs2uint_sloc1_1_0 + 2)
408         mov     (___fs2uint_sloc1_1_0 + 2),a
409         clr     a
410         subb    a,(___fs2uint_sloc1_1_0 + 3)
411         mov     (___fs2uint_sloc1_1_0 + 3),a
412 ; Peephole 132   changed ljmp to sjmp
413         sjmp 00113$
414 00112$:
415         mov     dptr,#___fs2uint_l_1_1
416         movx    a,@dptr
417         mov     ___fs2uint_sloc1_1_0,a
418         inc     dptr
419         movx    a,@dptr
420         mov     (___fs2uint_sloc1_1_0 + 1),a
421         inc     dptr
422         movx    a,@dptr
423         mov     (___fs2uint_sloc1_1_0 + 2),a
424         inc     dptr
425         movx    a,@dptr
426         mov     (___fs2uint_sloc1_1_0 + 3),a
427 00113$:
428         mov     r2,___fs2uint_sloc1_1_0
429         mov     r0,(___fs2uint_sloc1_1_0 + 1)
430         mov     dpl,r2
431         mov     dph,r0
432 00110$:
433         C$_fs2uint.c$97$1$1 ==.
434         XG$__fs2uint$0$0 ==.
435         ret
436         .area   CSEG    (CODE)