source: buchla-68k/alcyon/close.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: 2.5 KB
RevLine 
[7bf3856]1.globl _errno
2.globl _chantab
3.globl _Wrkbuf
4.globl __fatmod
5.globl __dirmod
6.globl __thebpb
7.globl __thedir
8.globl __thefat
9.globl __clsfat
10.text
11__clsfat:
12~~_clsfat:
13link R14,#-4
14*line 34
15*line 35
16clr (sp)
17move.l __thebpb,R8
18move 10(R8),-(sp)
19move.l __thebpb,R8
20move 8(R8),-(sp)
21move.l #__thefat,-(sp)
22move #1,-(sp)
23move #4,-(sp)
24jsr _trap13
25adda.l #12,sp
26*line 39
27*line 40
28clr (sp)
29move.l __thebpb,R8
30move 10(R8),-(sp)
31move.l __thebpb,R8
32clr R0
33move 8(R8),R0
34sub R0,(sp)
35move.l __thebpb,R8
36move 8(R8),-(sp)
37move.l #__thefat,-(sp)
38move #1,-(sp)
39move #4,-(sp)
40jsr _trap13
41adda.l #12,sp
42*line 42
43clr __fatmod
44L1:unlk R14
45rts
46.globl __clsdir
47.text
48__clsdir:
49~~_clsdir:
50link R14,#-4
51*line 55
52*line 56
53clr (sp)
54move.l __thebpb,R8
55move 10(R8),-(sp)
56move.l __thebpb,R8
57clr R0
58move 8(R8),R0
59add R0,(sp)
60move.l __thebpb,R8
61move 6(R8),-(sp)
62move.l #__thedir,-(sp)
63move #1,-(sp)
64move #4,-(sp)
65jsr _trap13
66adda.l #12,sp
67*line 58
68clr __dirmod
69L2:unlk R14
70rts
71.globl _close
72.text
73_close:
74~~close:
75~fd=8
76link R14,#0
77movem.l R6-R7/R13-R13,-(sp)
78~chp=R13
79~rc=R7
80*line 77
81*line 77
82tst 8(R14)
83blt L10000
84cmp #11,8(R14)
85ble L4
86L10000:*line 78
87*line 79
88move #9,_errno
89*line 80
90move #-1,R0
91bra L3
92*line 81
93*line 82
94L4:
95*line 83
96move 8(R14),R0
97muls #12,R0
98move.l R0,R13
99add.l #_chantab,R13
100*line 85
101move.l 8(R13),-(sp)
102move.l 4(R13),R8
103jsr (R8)
104addq.l #4,sp
105move R0,R7
106*line 87
107clr.b (R13)
108*line 88
109clr.b 1(R13)
110*line 89
111clr.b 2(R13)
112*line 90
113clr.b 3(R13)
114*line 91
115move.l #__badfd,4(R13)
116*line 93
117*line 94
118tst __fatmod
119beq L5
120*line 94
121jsr __clsfat
122*line 95
123L5:
124*line 96
125*line 97
126tst __dirmod
127beq L6
128*line 97
129jsr __clsdir
130*line 98
131L6:
132*line 99
133move R7,R0
134bra L3
135L3:tst.l (sp)+
136movem.l (sp)+,R7-R7/R13-R13
137unlk R14
138rts
139.globl __filecl
140.text
141__filecl:
142~~_filecl:
143~fp=R13
144link R14,#0
145movem.l R6-R7/R13-R13,-(sp)
146~rc=R7
147*line 117
148move.l 8(R14),R13
149*line 117
150move.l R13,(sp)
151jsr _ClsFile
152move R0,R7
153*line 118
154clr 32(R13)
155*line 119
156move R7,R0
157bra L7
158L7:tst.l (sp)+
159movem.l (sp)+,R7-R7/R13-R13
160unlk R14
161rts
162.globl __fd_cls
163.text
164__fd_cls:
165~~_fd_cls:
166link R14,#0
167movem.l R6-R7,-(sp)
168~fd=R7
169*line 132
170clr R7
171bra L11
172L12:
173*line 133
174*line 134
175move R7,R0
176muls #12,R0
177move.l R0,R8
178move.l #_chantab,R9
179move.l 4(R8,R9.l),R0
180cmp.l #__badfd,R0
181beq L13
182*line 134
183move R7,(sp)
184jsr _close
185*line 135
186L13:L10:
187*line 132
188add #1,R7
189L11:
190*line 132
191cmp #11,R7
192blt L12
193L9:
194*line 136
195jsr __clsvol
196L8:tst.l (sp)+
197movem.l (sp)+,R7-R7
198unlk R14
199rts
200.data
Note: See TracBrowser for help on using the repository browser.