source: buchla-68k/alcyon/write.s@ 4810254

Last change on this file since 4810254 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 5.3 KB
Line 
1.globl _chantab
2.globl _Wrkbuf
3.globl _errno
4.globl __fatmod
5.globl __thefat
6.globl __thebpb
7.data
8L1:
9*line 37
10.dc.l __badfd
11*line 38
12.dc.l __filewr
13*line 40
14.dc.l __conwr
15.text
16.globl __putsec
17.text
18__putsec:
19~~_putsec:
20~fp=R13
21~buf=12
22~len=16
23link R14,#0
24movem.l R7-R7/R13-R13,-(sp)
25*line 63
26move.l 8(R14),R13
27*line 63
28*line 63
29move.l #_Wrkbuf,(sp)
30move.l R13,-(sp)
31jsr _ReadRN
32addq.l #4,sp
33move R0,_errno
34cmp #1,R0
35bne L3
36*line 64
37*line 69
38*line 70
39*line 71
40clr _errno
41*line 72
42move #512,(sp)
43move #26,-(sp)
44move.l #_Wrkbuf,-(sp)
45jsr _memset
46addq.l #6,sp
47*line 73
48bra L4
49L3:
50*line 74
51*line 75
52tst _errno
53beq L5
54*line 75
55move #-1,R0
56bra L2
57*line 76
58L5:L4:
59*line 77
60move 16(R14),(sp)
61move.l 12(R14),-(sp)
62clr R0
63move 38(R13),R0
64swap R0
65clr R0
66swap R0
67add.l #_Wrkbuf,R0
68move.l R0,-(sp)
69jsr _memcpy
70addq.l #8,sp
71*line 79
72*line 79
73move.l #_Wrkbuf,(sp)
74move.l R13,-(sp)
75jsr _WriteRN
76addq.l #4,sp
77move R0,_errno
78beq L6
79*line 80
80*line 85
81*line 86
82*line 87
83move #-1,R0
84bra L2
85*line 88
86*line 89
87L6:
88*line 90
89*line 90
90clr R0
91move 38(R13),R0
92add 16(R14),R0
93and #511,R0
94move R0,38(R13)
95bne L7
96*line 91
97*line 92
98add.l #$1,40(R13)
99*line 93
100*line 94
101*line 94
102move.l R13,(sp)
103jsr __seek
104tst R0
105bge L8
106*line 95
107*line 100
108*line 101
109*line 102
110move #-1,R0
111bra L2
112*line 103
113L8:
114*line 104
115*line 105
116*line 110
117*line 111
118L7:
119*line 112
120clr R0
121bra L2
122L2:tst.l (sp)+
123movem.l (sp)+,R13-R13
124unlk R14
125rts
126.globl __filewr
127.text
128__filewr:
129~~_filewr:
130~fp=R13
131~buffer=R12
132~len=R7
133link R14,#-2
134movem.l R2-R7/R12-R13,-(sp)
135~j=R6
136~k=R5
137~l=R4
138~clustr=-2
139~curpos=R3
140*line 135
141move.l 8(R14),R13
142*line 135
143move.l 12(R14),R12
144*line 135
145move 16(R14),R7
146*line 135
147clr.l R3
148move 38(R13),R3
149move.l 40(R13),R0
150move.l #$9,R1
151asl.l R1,R0
152add.l R0,R3
153*line 137
154*line 137
155tst 26(R13)
156bne L10
157*line 138
158*line 144
159*line 145
160*line 146
161*line 146
162jsr __newcls
163move R0,-2(R14)
164bne L11
165*line 147
166*line 148
167move #5,_errno
168*line 149
169clr R0
170move R7,R0
171bra L9
172*line 150
173*line 151
174L11:
175*line 152
176move -2(R14),(sp)
177jsr _micons
178move R0,26(R13)
179*line 153
180move #4088,(sp)
181move -2(R14),-(sp)
182move.l #__thefat,-(sp)
183jsr __ptcl12
184addq.l #6,sp
185*line 154
186move #1,__fatmod
187*line 155
188move -2(R14),(sp)
189move.l __thebpb,-(sp)
190jsr __cl2lsn
191addq.l #4,sp
192ext.l R0
193move.l R0,44(R13)
194*line 156
195move -2(R14),36(R13)
196*line 157
197clr 34(R13)
198*line 158
199move.l __thebpb,R8
200clr R0
201move 2(R8),R0
202swap R0
203clr R0
204swap R0
205move.l R0,52(R13)
206*line 166
207*line 167
208*line 168
209L10:
210*line 169
211clr R4
212*line 177
213*line 177
214tst 38(R13)
215beq L12
216*line 178
217*line 179
218*line 180
219move #512,R4
220sub 38(R13),R4
221clr R0
222move R4,R0
223cmp R0,R7
224bcc L13
225*line 180
226move R7,R4
227*line 181
228L13:
229*line 182
230*line 183
231move R4,(sp)
232move.l R12,-(sp)
233move.l R13,-(sp)
234jsr __putsec
235addq.l #8,sp
236tst R0
237beq L14
238*line 183
239move #-1,R0
240bra L9
241L14:
242*line 184
243*line 185
244L12:
245*line 186
246*line 186
247move R7,R5
248sub R4,R5
249move #9,R0
250lsr R0,R5
251beq L15
252*line 187
253*line 188
254*line 188
255move R5,(sp)
256move.l R12,R0
257clr.l R1
258move R4,R1
259add.l R1,R0
260move.l R0,-(sp)
261move.l R13,-(sp)
262jsr _blkwr
263addq.l #8,sp
264move R0,R6
265tst R6
266beq L16
267*line 189
268*line 190
269clr R0
270move R5,R0
271sub R6,R0
272move #9,R1
273lsl R1,R0
274add R0,R4
275*line 191
276*line 192
277*line 193
278move.l R3,R0
279clr.l R1
280move R4,R1
281add.l R1,R0
282cmp.l 48(R13),R0
283ble L17
284*line 193
285move.l R3,R0
286clr.l R1
287move R4,R1
288add.l R1,R0
289move.l R0,48(R13)
290move.l R0,(sp)
291jsr _miconl
292move.l R0,28(R13)
293*line 194
294*line 199
295*line 200
296L17:
297*line 201
298clr R0
299move R4,R0
300bra L9
301*line 202
302*line 203
303L16:
304*line 204
305clr R0
306move R5,R0
307move #9,R1
308lsl R1,R0
309add R0,R4
310*line 205
311*line 206
312*line 207
313L15:
314*line 208
315*line 208
316cmp R7,R4
317bcc L18
318*line 209
319*line 210
320*line 210
321move R7,(sp)
322clr R0
323move R4,R0
324sub R0,(sp)
325move.l R12,R0
326clr.l R1
327move R4,R1
328add.l R1,R0
329move.l R0,-(sp)
330move.l R13,-(sp)
331jsr __putsec
332addq.l #8,sp
333tst R0
334beq L19
335*line 211
336*line 212
337*line 213
338move.l R3,R0
339clr.l R1
340move R4,R1
341add.l R1,R0
342cmp.l 48(R13),R0
343ble L20
344*line 213
345move.l R3,R0
346clr.l R1
347move R4,R1
348add.l R1,R0
349move.l R0,48(R13)
350move.l R0,(sp)
351jsr _miconl
352move.l R0,28(R13)
353*line 214
354*line 219
355*line 220
356L20:
357*line 221
358clr R0
359move R4,R0
360bra L9
361*line 222
362L19:
363*line 223
364*line 224
365L18:
366*line 225
367*line 226
368move.l R3,R0
369clr.l R1
370move R7,R1
371add.l R1,R0
372cmp.l 48(R13),R0
373ble L21
374*line 226
375move.l R3,R0
376clr.l R1
377move R7,R1
378add.l R1,R0
379move.l R0,48(R13)
380move.l R0,(sp)
381jsr _miconl
382move.l R0,28(R13)
383*line 227
384*line 232
385*line 233
386L21:
387*line 234
388clr R0
389move R7,R0
390bra L9
391L9:tst.l (sp)+
392movem.l (sp)+,R3-R7/R12-R13
393unlk R14
394rts
395.globl _write
396.text
397_write:
398~~write:
399~fd=8
400~buff=10
401~len=14
402link R14,#0
403movem.l R7-R7/R13-R13,-(sp)
404~chp=R13
405*line 254
406*line 254
407tst 8(R14)
408blt L10000
409cmp #11,8(R14)
410ble L23
411L10000:*line 255
412*line 256
413move #9,_errno
414*line 257
415move #-1,R0
416bra L22
417*line 258
418*line 259
419L23:
420*line 260
421move 8(R14),R0
422muls #12,R0
423move.l R0,R13
424add.l #_chantab,R13
425*line 262
426move 14(R14),-(sp)
427move.l 10(R14),-(sp)
428move.l 8(R13),-(sp)
429move.b 1(R13),R0
430ext.w R0
431move R0,R8
432add.l R8,R8
433add.l R8,R8
434move.l #L1,R9
435move.l 0(R8,R9.l),R8
436jsr (R8)
437adda.l #10,sp
438bra L22
439L22:tst.l (sp)+
440movem.l (sp)+,R13-R13
441unlk R14
442rts
443.data
Note: See TracBrowser for help on using the repository browser.