source: buchla-68k/alcyon/rawio.s@ 526a993

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 4.5 KB
Line 
1.globl _readln
2.text
3_readln:
4~~readln:
5~unit=8
6~nc=10
7~ctl=12
8~nb=16
9~buf=18
10link R14,#0
11movem.l R4-R7/R12-R13,-(sp)
12~cp=R13
13~i=R7
14~j=R6
15~bp=R12
16~c=R5
17*line 83
18*line 84
19cmp #1,8(R14)
20blt L10000
21cmp #4,8(R14)
22ble L2
23L10000:*line 84
24move.l #$fffffff1,R0
25bra L1
26*line 85
27L2:
28*line 86
29move.l 18(R14),R12
30*line 88
31clr R7
32bra L5
33L6:
34*line 89
35*line 90
36move 8(R14),(sp)
37move #2,-(sp)
38jsr _trap13
39addq.l #2,sp
40and.l #$ff,R0
41move.b R0,R5
42*line 91
43*line 92
44move.b R5,(R12)+
45*line 93
46clr.b (R12)
47*line 94
48*line 95
49move.l 12(R14),R13
50*line 96
51*line 97
52clr R6
53bra L9
54L10:
55*line 98
56*line 99
57move.b R5,R0
58ext.w R0
59move.l 12(R14),R9
60move.b (R9),R1
61ext.w R1
62cmp R1,R0
63move sr,R0
64add.l #1,12(R14)
65move R0,ccr
66bne L11
67*line 99
68move.b R5,R0
69ext.w R0
70bra L1
71*line 100
72L11:L8:
73*line 97
74add #1,R6
75L9:
76*line 97
77cmp 10(R14),R6
78blt L10
79L7:
80*line 101
81move.b R5,R0
82ext.w R0
83move R0,(sp)
84move 8(R14),-(sp)
85move #3,-(sp)
86jsr _trap13
87addq.l #4,sp
88L4:
89*line 88
90add #1,R7
91L5:
92*line 88
93cmp 16(R14),R7
94blt L6
95L3:
96*line 104
97move.l #$ffffffff,R0
98bra L1
99L1:tst.l (sp)+
100movem.l (sp)+,R5-R7/R12-R13
101unlk R14
102rts
103.globl _getln
104.text
105_getln:
106~~getln:
107~unit=8
108~nb=10
109~buf=12
110link R14,#0
111movem.l R5-R7/R13-R13,-(sp)
112~bp=R13
113~c=R7
114~bc=R6
115*line 119
116clr R6
117*line 120
118move.l 12(R14),R13
119*line 121
120clr.b (R13)
121*line 123
122bra L15
123L14:
124*line 124
125*line 125
126move 8(R14),(sp)
127move #2,-(sp)
128jsr _trap13
129addq.l #2,sp
130and.l #$ff,R0
131move.b R0,R7
132*line 126
133*line 127
134move.b R7,R0
135ext.w R0
136bra L17
137*line 128
138L18:
139*line 129
140L19:
141*line 130
142*line 131
143*line 132
144*line 132
145tst R6
146bne L20
147*line 133
148*line 134
149move #7,(sp)
150move 8(R14),-(sp)
151move #3,-(sp)
152jsr _trap13
153addq.l #4,sp
154bra L16
155*line 135
156*line 136
157bra L21
158L20:
159*line 137
160*line 138
161*line 139
162sub #1,R6
163*line 140
164sub.l #1,R13
165*line 141
166clr.b (R13)
167*line 142
168move #8,(sp)
169move 8(R14),-(sp)
170move #3,-(sp)
171jsr _trap13
172addq.l #4,sp
173*line 143
174move #32,(sp)
175move 8(R14),-(sp)
176move #3,-(sp)
177jsr _trap13
178addq.l #4,sp
179*line 144
180move #8,(sp)
181move 8(R14),-(sp)
182move #3,-(sp)
183jsr _trap13
184addq.l #4,sp
185bra L16
186*line 145
187L21:
188*line 146
189*line 147
190L22:
191*line 148
192L23:
193*line 149
194*line 150
195*line 151
196move.b R7,(R13)+
197*line 152
198clr.b (R13)
199*line 153
200move.b R7,R0
201ext.w R0
202bra L12
203*line 154
204*line 155
205*line 156
206L24:
207*line 157
208*line 158
209*line 159
210move.l 12(R14),R8
211clr.b (R8)
212*line 160
213move.b R7,R0
214ext.w R0
215bra L12
216*line 161
217L25:
218*line 162
219*line 163
220*line 164
221move.b R7,(R13)+
222*line 165
223clr.b (R13)
224*line 166
225move.b R7,R0
226ext.w R0
227move R0,(sp)
228move 8(R14),-(sp)
229move #3,-(sp)
230jsr _trap13
231addq.l #4,sp
232*line 167
233add #1,R6
234bra L16
235L17:ext.l R0
236move.l #L26,R8
237move #5,R1
238L27:cmp.l (R8)+,R0
239dbeq R1,L27
240move.l 20(R8),R8
241jmp (R8)
242.data
243L26:.dc.l 8
244.dc.l 10
245.dc.l 13
246.dc.l 24
247.dc.l 127
248.dc.l 0
249.dc.l L18
250.dc.l L23
251.dc.l L22
252.dc.l L24
253.dc.l L19
254.dc.l L25
255.text
256L16:
257*line 168
258L15:
259*line 169
260cmp 10(R14),R6
261blt L14
262L13:
263*line 171
264move.l #$ffffffff,R0
265bra L12
266L12:tst.l (sp)+
267movem.l (sp)+,R6-R7/R13-R13
268unlk R14
269rts
270.globl _getrln
271.text
272_getrln:
273~~getrln:
274~unit=8
275~nb=10
276~buf=12
277link R14,#0
278movem.l R5-R7/R13-R13,-(sp)
279~bp=R13
280~c=R7
281~bc=R6
282*line 186
283clr R6
284*line 187
285move.l 12(R14),R13
286*line 188
287clr.b (R13)
288*line 190
289bra L31
290L30:
291*line 191
292*line 192
293move 8(R14),(sp)
294move #2,-(sp)
295jsr _trap13
296addq.l #2,sp
297and.l #$ff,R0
298move.b R0,R7
299*line 193
300*line 194
301move.b R7,R0
302ext.w R0
303bra L33
304*line 195
305L34:
306*line 196
307L35:
308*line 197
309L36:
310*line 198
311*line 199
312*line 200
313move.b R7,(R13)+
314*line 201
315clr.b (R13)
316*line 202
317move.b R7,R0
318ext.w R0
319bra L28
320*line 203
321L37:
322*line 204
323*line 205
324*line 206
325move.l 12(R14),R8
326clr.b (R8)
327*line 207
328move.b R7,R0
329ext.w R0
330bra L28
331*line 208
332L38:
333*line 209
334*line 210
335*line 211
336move.b R7,(R13)+
337*line 212
338clr.b (R13)
339*line 213
340add #1,R6
341bra L32
342L33:cmp #10,R0
343beq L35
344cmp #13,R0
345beq L34
346cmp #24,R0
347beq L37
348cmp #26,R0
349beq L36
350bra L38
351L32:
352*line 214
353L31:
354*line 215
355cmp 10(R14),R6
356blt L30
357L29:
358*line 217
359move.l #$ffffffff,R0
360bra L28
361L28:tst.l (sp)+
362movem.l (sp)+,R6-R7/R13-R13
363unlk R14
364rts
365.globl _writeln
366.text
367_writeln:
368~~writeln:
369~unit=8
370~buf=10
371link R14,#0
372movem.l R6-R7/R13-R13,-(sp)
373~bp=R13
374~c=R7
375*line 229
376move.l 10(R14),R13
377*line 231
378bra L42
379L41:
380*line 232
381move.b R7,R0
382ext.w R0
383move R0,(sp)
384move 8(R14),-(sp)
385move #3,-(sp)
386jsr _trap13
387addq.l #4,sp
388L42:
389*line 232
390move.b (R13)+,R7
391bne L41
392L40:L39:tst.l (sp)+
393movem.l (sp)+,R7-R7/R13-R13
394unlk R14
395rts
396.data
Note: See TracBrowser for help on using the repository browser.