source: buchla-68k/alcyon/read.s@ 050d522

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 3.4 KB
Line 
1.globl _chantab
2.globl _Wrkbuf
3.globl _errno
4.data
5L1:
6*line 56
7.dc.l __badfd
8*line 57
9.dc.l __filerd
10*line 59
11.dc.l __conin
12.text
13.globl _read
14.text
15_read:
16~~read:
17~fd=8
18~buff=10
19~len=14
20link R14,#0
21movem.l R7-R7/R13-R13,-(sp)
22~chp=R13
23*line 79
24*line 79
25tst 8(R14)
26blt L10000
27cmp #11,8(R14)
28ble L3
29L10000:*line 80
30*line 81
31move #9,_errno
32*line 82
33move #-1,R0
34bra L2
35*line 83
36*line 84
37L3:
38*line 85
39move 8(R14),R0
40muls #12,R0
41move.l R0,R13
42add.l #_chantab,R13
43*line 86
44move 14(R14),-(sp)
45move.l 10(R14),-(sp)
46move.l 8(R13),-(sp)
47move.b (R13),R0
48ext.w R0
49move R0,R8
50add.l R8,R8
51add.l R8,R8
52move.l #L1,R9
53move.l 0(R8,R9.l),R8
54jsr (R8)
55adda.l #10,sp
56bra L2
57L2:tst.l (sp)+
58movem.l (sp)+,R13-R13
59unlk R14
60rts
61.globl __getsec
62.text
63__getsec:
64~~_getsec:
65~fp=R13
66~buf=12
67~len=16
68link R14,#0
69movem.l R7-R7/R13-R13,-(sp)
70*line 105
71move.l 8(R14),R13
72*line 105
73*line 106
74move.l #_Wrkbuf,(sp)
75move.l R13,-(sp)
76jsr _ReadRN
77addq.l #4,sp
78move R0,_errno
79beq L5
80*line 106
81move #-1,R0
82bra L4
83*line 107
84L5:
85*line 108
86move 16(R14),(sp)
87clr R0
88move 38(R13),R0
89swap R0
90clr R0
91swap R0
92add.l #_Wrkbuf,R0
93move.l R0,-(sp)
94move.l 12(R14),-(sp)
95jsr _memcpy
96addq.l #8,sp
97*line 110
98*line 110
99clr R0
100move 38(R13),R0
101add 16(R14),R0
102and #511,R0
103move R0,38(R13)
104bne L6
105*line 111
106*line 112
107add.l #$1,40(R13)
108*line 113
109*line 114
110*line 115
111move.l R13,(sp)
112jsr __seek
113tst R0
114bge L7
115*line 115
116move #-1,R0
117bra L4
118L7:
119*line 116
120*line 117
121L6:
122*line 118
123clr R0
124bra L4
125L4:tst.l (sp)+
126movem.l (sp)+,R13-R13
127unlk R14
128rts
129.globl __filerd
130.text
131__filerd:
132~~_filerd:
133~fp=R13
134~buffer=12
135~len=16
136link R14,#0
137movem.l R2-R7/R13-R13,-(sp)
138~l=R7
139~j=R6
140~k=R5
141~curpos=R4
142~newpos=R3
143*line 141
144move.l 8(R14),R13
145*line 141
146clr R7
147*line 142
148clr.l R4
149move 38(R13),R4
150move.l 40(R13),R0
151move.l #$9,R1
152asl.l R1,R0
153add.l R0,R4
154*line 143
155move.l R4,R3
156clr.l R0
157move 16(R14),R0
158add.l R0,R3
159*line 151
160*line 151
161cmp.l 48(R13),R3
162ble L9
163*line 152
164*line 153
165move.l 48(R13),R0
166sub.l R4,R0
167move R0,16(R14)
168*line 154
169*line 158
170*line 159
171*line 160
172L9:
173*line 161
174*line 161
175tst 38(R13)
176beq L10
177*line 162
178*line 163
179*line 164
180move #512,R7
181sub 38(R13),R7
182clr R0
183move R7,R0
184cmp 16(R14),R0
185bls L11
186*line 164
187move 16(R14),R7
188*line 165
189L11:
190*line 166
191*line 167
192move R7,(sp)
193move.l 12(R14),-(sp)
194move.l R13,-(sp)
195jsr __getsec
196addq.l #8,sp
197tst R0
198beq L12
199*line 167
200clr R0
201move 16(R14),R0
202bra L8
203L12:
204*line 168
205*line 169
206L10:
207*line 170
208*line 171
209move 16(R14),R5
210sub R7,R5
211move #9,R0
212lsr R0,R5
213beq L13
214*line 171
215*line 172
216move R5,(sp)
217clr R0
218move R7,R0
219swap R0
220clr R0
221swap R0
222add.l 12(R14),R0
223move.l R0,-(sp)
224move.l R13,-(sp)
225jsr _blkrd
226addq.l #8,sp
227move R0,R6
228tst R6
229beq L14
230*line 172
231clr R0
232move R7,R0
233clr R1
234move R5,R1
235sub R6,R1
236move #9,R2
237lsl R2,R1
238add R1,R0
239bra L8
240*line 173
241L14:L13:
242*line 174
243clr R0
244move R5,R0
245move #9,R1
246lsl R1,R0
247add R0,R7
248*line 176
249*line 177
250cmp 16(R14),R7
251bcc L15
252*line 177
253*line 178
254move 16(R14),(sp)
255clr R0
256move R7,R0
257sub R0,(sp)
258clr R0
259move R7,R0
260swap R0
261clr R0
262swap R0
263add.l 12(R14),R0
264move.l R0,-(sp)
265move.l R13,-(sp)
266jsr __getsec
267addq.l #8,sp
268tst R0
269beq L16
270*line 178
271clr R0
272move R7,R0
273bra L8
274*line 179
275L16:L15:
276*line 180
277clr R0
278move 16(R14),R0
279bra L8
280L8:tst.l (sp)+
281movem.l (sp)+,R3-R7/R13-R13
282unlk R14
283rts
284.data
Note: See TracBrowser for help on using the repository browser.