source: buchla-68k/alcyon/scadv.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: 6.5 KB
Line 
1.globl _io_time
2.globl _io_lcd
3.globl _io_ser
4.globl _io_midi
5.globl _io_disk
6.globl _io_tone
7.globl _io_leds
8.globl _io_kbrd
9.globl _lcd_a0
10.globl _lcd_a1
11.globl _io_vreg
12.globl _io_vraw
13.globl _io_vram
14.globl _io_fpu
15.globl _v_regs
16.globl _v_odtab
17.globl _v_actab
18.globl _v_ct0
19.globl _v_gt1
20.globl _v_score
21.globl _v_cgtab
22.globl _v_curs0
23.globl _v_curs1
24.globl _v_curs2
25.globl _v_curs3
26.globl _v_curs4
27.globl _v_curs5
28.globl _v_curs6
29.globl _v_curs7
30.globl _v_tcur
31.globl _v_kbobj
32.globl _v_lnobj
33.globl _v_win0
34.globl _v_cur
35.globl _fc_sw
36.globl _fc_val
37.globl _consl
38.globl _cursl
39.globl _nxtsl
40.globl _prvsl
41.globl _saddr
42.globl _scrl
43.globl _vi_sadr
44.globl _vi_scrl
45.globl _ctrsw
46.globl _ndisp
47.globl _sbase
48.globl _sd
49.globl _soffset
50.globl _gdstbc
51.globl _gdstbn
52.globl _gdstbp
53.globl _nbmoff
54.data
55_nbmoff:
56.dc.w $3
57.globl _wrdoff
58.data
59_wrdoff:
60.dc.w $3
61.globl _nbmasks
62.data
63_nbmasks:
64.dc.w $F
65.dc.w $F0
66.dc.w $F00
67.dc.w $F000
68.globl _sc_adv
69.text
70_sc_adv:
71~~sc_adv:
72link R14,#-6
73movem.l R2-R7/R11-R13,-(sp)
74~masksl=R7
75~maskpx=R6
76~i=R5
77~sword=R4
78~tl=R3
79~optr=R13
80~pptr=R12
81~fsl=R11
82~qptr=-4
83~pscrl=-6
84*line 101
85*line 102
86clr R0
87move 10+_v_regs,R0
88and #384,R0
89beq L2
90*line 102
91clr (sp)
92jsr _vbank
93*line 103
94L2:
95*line 104
96move.l #$80,R3
97*line 108
98jsr _ucslice
99*line 114
100*line 114
101cmp #2,_ndisp
102bne L3
103cmp #1,_sd
104bne L10000
105clr R0
106bra L10002
107L10000:move #3,R0
108L10002:cmp _soffset,R0
109bne L3
110*line 115
111*line 116
112*line 116
113cmp #1,_sd
114bne L4
115*line 117
116*line 118
117move.l _prvsl,R11
118*line 119
119move _wrdoff,R0
120asl #1,R0
121ext.l R0
122move.l R0,R13
123add.l _saddr,R13
124*line 120
125bra L5
126L4:
127*line 121
128*line 122
129*line 123
130move.l _nxtsl,R11
131*line 124
132move.l R3,R0
133asl.l #1,R0
134move.l R0,R13
135add.l _saddr,R13
136L5:
137*line 125
138*line 126
139*line 127
140*line 127
141cmp #28544,_sbase
142ble L6
143*line 128
144*line 129
145*line 130
146*line 131
147move.l _saddr,R12
148cmp #1,_sd
149bne L10003
150move.l #$6f7e,R0
151bra L10005
152L10003:move.l #$6f81,R0
153L10005:asl.l #1,R0
154sub.l R0,R12
155*line 132
156*line 133
157*line 133
158cmp #28672,_sbase
159bge L7
160*line 134
161*line 135
162*line 136
163*line 137
164move #224,R5
165bra L10
166L11:
167*line 138
168*line 139
169move (R11)+,R4
170*line 140
171move R4,(R13)
172*line 141
173move R4,(R12)
174*line 142
175move.l R3,R0
176asl.l #1,R0
177add.l R0,R13
178*line 143
179move.l R3,R0
180asl.l #1,R0
181add.l R0,R12
182L9:L10:
183*line 137
184move R5,R0
185sub #1,R5
186tst R0
187bne L11
188L8:
189*line 144
190*line 145
191bra L12
192L7:
193*line 146
194*line 147
195*line 148
196*line 149
197*line 150
198move #224,R5
199bra L15
200L16:
201*line 151
202*line 152
203move (R11)+,(R12)
204*line 153
205move.l R3,R0
206asl.l #1,R0
207add.l R0,R12
208L14:L15:
209*line 150
210move R5,R0
211sub #1,R5
212tst R0
213bne L16
214L13:
215*line 154
216L12:
217*line 155
218*line 156
219*line 157
220bra L17
221L6:
222*line 158
223*line 159
224*line 160
225*line 161
226*line 162
227move #224,R5
228bra L20
229L21:
230*line 163
231*line 164
232move (R11)+,(R13)
233*line 165
234move.l R3,R0
235asl.l #1,R0
236add.l R0,R13
237L19:L20:
238*line 162
239move R5,R0
240sub #1,R5
241tst R0
242bne L21
243L18:
244*line 166
245L17:
246*line 167
247*line 168
248*line 169
249move.l _nxtsl,R13
250*line 170
251move.l _cursl,R12
252*line 171
253move.l _prvsl,-4(R14)
254*line 172
255move.l _consl,R11
256*line 173
257*line 174
258move #224,R5
259bra L24
260L25:
261*line 175
262*line 176
263move (R11)+,R4
264*line 177
265move R4,(R13)+
266*line 178
267move R4,(R12)+
268*line 179
269move.l -4(R14),R8
270move R4,(R8)
271add.l #2,-4(R14)
272L23:L24:
273*line 174
274move R5,R0
275sub #1,R5
276tst R0
277bne L25
278L22:
279*line 180
280*line 181
281*line 182
282*line 183
283*line 184
284*line 185
285*line 186
286L3:
287*line 187
288*line 187
289tst _sd
290bne L26
291*line 188
292*line 189
293*line 189
294add #1,_soffset
295move _soffset,R0
296cmp #3,R0
297ble L27
298*line 190
299*line 191
300clr _soffset
301*line 192
302add.l #2,_saddr
303*line 193
304*line 194
305*line 194
306add #1,_sbase
307move _sbase,R0
308cmp #28672,R0
309ble L28
310*line 195
311*line 196
312move.l #_v_score,_saddr
313*line 197
314clr _sbase
315*line 198
316L28:
317*line 199
318*line 200
319L27:bra L29
320L26:
321*line 201
322*line 202
323*line 203
324*line 203
325sub #1,_soffset
326bge L30
327*line 204
328*line 205
329move #3,_soffset
330*line 206
331sub.l #2,_saddr
332*line 207
333*line 208
334*line 208
335sub #1,_sbase
336bge L31
337*line 209
338*line 210
339move.l #57344+_v_score,_saddr
340*line 211
341move #28672,_sbase
342*line 212
343L31:
344*line 213
345L30:L29:
346*line 217
347move _scrl,-6(R14)
348*line 221
349move _soffset,R8
350add.l R8,R8
351add.l #_nbmasks,R8
352move (R8),R6
353*line 222
354move R6,R0
355not R0
356move R0,R7
357*line 224
358move.l #_gdstbp,(sp)
359move R7,-(sp)
360move R6,-(sp)
361move.l _prvsl,-(sp)
362jsr _uslice
363addq.l #8,sp
364*line 226
365move.l #_gdstbn,(sp)
366move R7,-(sp)
367move R6,-(sp)
368move.l _nxtsl,-(sp)
369jsr _uslice
370addq.l #8,sp
371*line 228
372move _soffset,R0
373asr #1,R0
374move #1,R1
375eor R1,R0
376or #-32768,R0
377move R0,_scrl
378*line 232
379*line 232
380cmp #2,_ndisp
381bne L32
382clr R0
383move _scrl,R0
384cmp -6(R14),R0
385beq L32
386*line 233
387*line 234
388move.l _saddr,R0
389asr.l #1,R0
390move R0,R4
391*line 235
392*line 236
393move #1,(sp)
394jsr _setipl
395*line 237
396*line 238
397move _scrl,_vi_scrl
398*line 239
399move R4,_vi_sadr
400*line 240
401*line 241
402clr (sp)
403jsr _setipl
404*line 242
405*line 243
406L32:
407*line 244
408clr _ctrsw
409L1:tst.l (sp)+
410movem.l (sp)+,R3-R7/R11-R13
411unlk R14
412rts
413.globl _scupd
414.text
415_scupd:
416~~scupd:
417link R14,#-2
418movem.l R2-R7/R11-R13,-(sp)
419~masksl=R7
420~maskpx=R6
421~i=R5
422~sword=R4
423~tl=R3
424~optr=R13
425~qptr=R12
426~fsl=R11
427~soff=-2
428*line 275
429*line 276
430clr R0
431move 10+_v_regs,R0
432and #384,R0
433beq L34
434*line 276
435clr (sp)
436jsr _vbank
437*line 277
438L34:
439*line 278
440move _nbmoff,R0
441add _soffset,R0
442and #3,R0
443move R0,-2(R14)
444*line 279
445move -2(R14),R0
446add #2,R0
447and #3,R0
448move R0,R8
449add.l R8,R8
450add.l #_nbmasks,R8
451move (R8),R6
452*line 280
453move R6,R0
454not R0
455move R0,R7
456*line 281
457move.l #$80,R3
458*line 285
459*line 285
460move.l #_gdstbc,(sp)
461move R7,-(sp)
462move R6,-(sp)
463move.l _cursl,-(sp)
464jsr _cslice
465addq.l #8,sp
466tst R0
467beq L35
468cmp #2,_ndisp
469bne L35
470*line 286
471*line 287
472*line 288
473*line 289
474move.l _cursl,R11
475*line 290
476cmp #1,-2(R14)
477ble L10006
478move.l #$40,R0
479bra L10008
480L10006:move.l #$3f,R0
481L10008:asl.l #1,R0
482move.l R0,R13
483add.l _saddr,R13
484*line 291
485move.l _consl,R12
486*line 292
487*line 293
488move #224,R5
489bra L38
490L39:
491*line 294
492*line 295
493*line 296
494move R6,R4
495and (R11),R4
496beq L40
497*line 296
498clr R0
499move R4,R0
500move R7,R1
501and (R13),R1
502or R1,R0
503move R0,(R13)
504*line 297
505L40:
506*line 298
507move (R12)+,(R11)+
508*line 299
509move.l R3,R0
510asl.l #1,R0
511add.l R0,R13
512L37:L38:
513*line 293
514move R5,R0
515sub #1,R5
516tst R0
517bne L39
518L36:
519*line 300
520*line 301
521*line 302
522*line 303
523*line 304
524L35:
525*line 305
526clr _ctrsw
527L33:tst.l (sp)+
528movem.l (sp)+,R3-R7/R11-R13
529unlk R14
530rts
531.data
Note: See TracBrowser for help on using the repository browser.