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