source: buchla-68k/alcyon/open.s@ 0170798

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 4.3 KB
Line 
1.globl _errno
2.globl _chantab
3.globl _Wrkbuf
4.data
5L1:.dc.b $2
6.dc.b $2
7.dc.b $1
8.dc.b $0
9*line 21
10.dc.l __noper
11.text
12.data
13L2:.dc.b $1
14.dc.b $1
15.dc.b $0
16.dc.b $1
17*line 22
18.dc.l __fileop
19.text
20.globl __fcbtab
21.data
22L3:
23*line 34
24.dc.l L4
25*line 34
26.dc.l L1
27.dc.l $2
28*line 35
29.dc.l L5
30*line 35
31.dc.l L1
32.dc.l $2
33.dc.l $0
34*line 37
35.dc.l L2
36.dc.l $0
37.text
38.globl _open
39.text
40_open:
41~~open:
42~name=8
43~flag=12
44~mode=14
45link R14,#-4
46movem.l R7-R7/R11-R13,-(sp)
47~dp=R13
48~chp=R12
49~dev=R11
50~fd=-2
51~mdmask=-4
52*line 64
53move.l #_chantab,R12
54clr -2(R14)
55bra L9
56L10:
57*line 65
58*line 66
59move.l 4(R12),R0
60cmp.l #__badfd,R0
61beq L11
62*line 67
63L8:
64*line 64
65add.l #12,R12
66add #1,-2(R14)
67L9:
68*line 64
69cmp #11,-2(R14)
70blt L10
71L7:
72*line 68
73move #24,_errno
74*line 69
75move #-1,R0
76bra L6
77L11:
78*line 74
79*line 75
80*line 76
81move.l #L3,R13
82bra L14
83L15:
84*line 77
85*line 78
86move.l 8(R14),(sp)
87move.l (R13),-(sp)
88jsr _strcmp
89addq.l #4,sp
90tst R0
91beq L12
92*line 79
93L13:
94*line 76
95add.l #12,R13
96L14:
97*line 76
98tst.l (R13)
99bne L15
100L12:
101*line 80
102move.l 4(R13),R11
103*line 81
104move 12(R14),R0
105and #3,R0
106add #1,R0
107move R0,-4(R14)
108*line 83
109*line 83
110btst #0,-3(R14)
111beq L16
112*line 84
113*line 85
114*line 85
115move.b (R11),(R12)
116bne L17
117*line 86
118*line 87
119move #13,_errno
120*line 88
121move #-1,R0
122bra L6
123*line 89
124L17:
125*line 90
126*line 91
127L16:
128*line 92
129*line 92
130btst #1,-3(R14)
131beq L18
132*line 93
133*line 94
134*line 94
135move.b 1(R11),1(R12)
136bne L19
137*line 95
138*line 96
139move #13,_errno
140*line 97
141move #-1,R0
142bra L6
143*line 98
144L19:
145*line 99
146*line 100
147*line 101
148*line 102
149L18:
150*line 103
151move.l 8(R13),8(R12)
152*line 104
153move.b 2(R11),2(R12)
154*line 105
155move.b 3(R11),3(R12)
156*line 106
157move.l #__noper,4(R12)
158*line 108
159*line 108
160move.l R13,-(sp)
161move.l R12,-(sp)
162move 14(R14),-(sp)
163move 12(R14),-(sp)
164move.l 8(R14),-(sp)
165move.l 4(R11),R8
166jsr (R8)
167adda.l #16,sp
168tst R0
169bge L20
170*line 109
171*line 110
172move.l #__badfd,4(R12)
173*line 111
174move #-1,R0
175bra L6
176*line 112
177*line 113
178L20:
179*line 114
180move -2(R14),R0
181bra L6
182L6:tst.l (sp)+
183movem.l (sp)+,R11-R13
184unlk R14
185rts
186.globl _opena
187.text
188_opena:
189~~opena:
190~name=8
191~flag=12
192~mode=14
193link R14,#-4
194*line 134
195move 14(R14),(sp)
196move 12(R14),-(sp)
197move.l 8(R14),-(sp)
198jsr _open
199addq.l #6,sp
200bra L21
201L21:unlk R14
202rts
203.globl _openb
204.text
205_openb:
206~~openb:
207~name=8
208~flag=12
209~mode=14
210link R14,#-4
211*line 151
212move 14(R14),(sp)
213move 12(R14),-(sp)
214or #-32768,(sp)
215move.l 8(R14),-(sp)
216jsr _open
217addq.l #6,sp
218bra L22
219L22:unlk R14
220rts
221.globl _creat
222.text
223_creat:
224~~creat:
225~name=8
226~mode=12
227link R14,#-4
228*line 172
229move 12(R14),(sp)
230move #769,-(sp)
231move.l 8(R14),-(sp)
232jsr _open
233addq.l #6,sp
234bra L23
235L23:unlk R14
236rts
237.globl _creata
238.text
239_creata:
240~~creata:
241~name=8
242~mode=12
243link R14,#-4
244*line 193
245move 12(R14),(sp)
246move #769,-(sp)
247move.l 8(R14),-(sp)
248jsr _open
249addq.l #6,sp
250bra L24
251L24:unlk R14
252rts
253.globl _creatb
254.text
255_creatb:
256~~creatb:
257~name=8
258~mode=12
259link R14,#-4
260*line 211
261move 12(R14),(sp)
262move #-31999,-(sp)
263move.l 8(R14),-(sp)
264jsr _creat
265addq.l #6,sp
266bra L25
267L25:unlk R14
268rts
269.globl __fileop
270.text
271__fileop:
272~~_fileop:
273~name=8
274~flag=12
275~mode=14
276~chp=16
277~dp=20
278link R14,#-14
279movem.l R7-R7/R13-R13,-(sp)
280~fp=R13
281~tmpname=-10
282~tmpext=-14
283*line 237
284move.l #__fcbtab,R13
285bra L29
286L30:
287*line 238
288*line 239
289tst 32(R13)
290beq L31
291*line 240
292L28:
293*line 237
294add.l #56,R13
295L29:
296*line 237
297cmp.l #448+__fcbtab,R13
298blo L30
299L27:
300*line 241
301move #23,_errno
302*line 242
303move #-1,R0
304bra L26
305L31:
306*line 244
307*line 245
308*line 246
309*line 247
310*line 248
311*line 248
312move 12(R14),(sp)
313move.l R14,-(sp)
314add.l #-14,(sp)
315move.l 8(R14),-(sp)
316jsr _FilExt
317addq.l #8,sp
318move.l R0,-(sp)
319move.l R14,-(sp)
320add.l #-10,(sp)
321move.l 8(R14),-(sp)
322jsr _FilName
323addq.l #8,sp
324move.l R0,-(sp)
325move.l R13,-(sp)
326jsr __inifcb
327adda.l #12,sp
328tst R0
329beq L32
330*line 249
331*line 250
332move #22,_errno
333*line 251
334move #-1,R0
335bra L26
336*line 252
337*line 253
338L32:
339*line 254
340*line 255
341move.l R13,(sp)
342jsr __opfcb
343tst R0
344beq L33
345*line 255
346move #-1,R0
347bra L26
348*line 256
349L33:
350*line 257
351move.l 16(R14),R8
352move.l R13,8(R8)
353*line 258
354move.l 16(R14),R8
355move.l #__filecl,4(R8)
356*line 260
357clr R0
358bra L26
359L26:tst.l (sp)+
360movem.l (sp)+,R13-R13
361unlk R14
362rts
363.data
364L4:.dc.b $63,$6F,$6E,$3A,$0
365L5:.dc.b $43,$4F,$4E,$3A,$0
Note: See TracBrowser for help on using the repository browser.