source: buchla-68k/alcyon/scinit.s@ abd4109

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

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 14.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 _sd
38.globl _curasg
39.globl _tmpoval
40.globl _curtun
41.globl _se_chg
42.globl _spcount
43.globl _frags
44.globl _se1_cnt
45.globl _se2_cnt
46.globl _se3_cnt
47.globl _pspool
48.globl _size1
49.globl _size2
50.globl _size3
51.globl _scores
52.globl _seclist
53.globl _hplist
54.globl _stimes
55.globl _scname
56.globl _curscor
57.globl _cursect
58.globl _scp
59.globl _t_bak
60.globl _t_cur
61.globl _t_ctr
62.globl _t_fwd
63.globl _p_bak
64.globl _p_cur
65.globl _p_ctr
66.globl _p_fwd
67.globl _spool
68.globl _evleft
69.text
70_evleft:
71~~evleft:
72link R14,#-4
73*line 146
74*line 147
75move.l #$6,-(sp)
76move.l _se2_cnt,-(sp)
77jsr lmul
78addq.l #8,sp
79move.l R0,-(sp)
80move.l #$5,-(sp)
81move.l _se1_cnt,-(sp)
82jsr lmul
83addq.l #8,sp
84add.l (sp)+,R0
85move.l _se3_cnt,R1
86asl.l #3,R1
87add.l R1,R0
88add.l _spcount,R0
89bra L1
90L1:unlk R14
91rts
92.globl _scinit
93.text
94_scinit:
95~~scinit:
96link R14,#0
97movem.l R6-R7/R13-R13,-(sp)
98~i=R7
99~cp=R13
100*line 165
101clr.l _se1_cnt
102*line 166
103clr.l _size1
104*line 167
105clr.l _se2_cnt
106*line 168
107clr.l _size2
108*line 169
109clr.l _se3_cnt
110*line 170
111clr.l _size3
112*line 171
113move.b #1,_se_chg
114*line 172
115clr.l _frags
116*line 174
117move.l #$8000,_spcount
118*line 175
119move.l #_spool,_pspool
120*line 176
121move.l #_spool,R13
122*line 178
123move.l _spcount,R7
124bra L5
125L6:
126*line 179
127clr.l (R13)+
128L4:L5:
129*line 178
130move.l R7,R0
131sub.l #$1,R7
132tst.l R0
133bgt L6
134L3:
135*line 181
136clr.l R7
137bra L9
138L10:
139*line 182
140move #16,(sp)
141move.l #L11,-(sp)
142move.l R7,R0
143asl.l #4,R0
144add.l #_scname,R0
145move.l R0,-(sp)
146jsr _memcpy
147addq.l #8,sp
148L8:
149*line 181
150add.l #$1,R7
151L9:
152*line 181
153cmp.l #$14,R7
154blt L10
155L7:
156*line 184
157move #40,(sp)
158clr -(sp)
159move.l #_scores,-(sp)
160jsr _memsetw
161addq.l #6,sp
162*line 185
163move #480,(sp)
164clr -(sp)
165move.l #_hplist,-(sp)
166jsr _memsetw
167addq.l #6,sp
168*line 186
169move #800,(sp)
170clr -(sp)
171move.l #_seclist,-(sp)
172jsr _memsetw
173addq.l #6,sp
174*line 187
175move #4800,(sp)
176clr -(sp)
177move.l #_stimes,-(sp)
178jsr _memset
179addq.l #6,sp
180*line 189
181clr.l R0
182move.l R0,_t_ctr
183move.l R0,_t_cur
184*line 190
185move.l _t_cur,R0
186add.l #$ffffff10,R0
187move.l R0,_t_bak
188*line 191
189move.l _t_cur,R0
190add.l #$102,R0
191move.l R0,_t_fwd
192*line 193
193clr.l _p_bak
194*line 194
195clr.l _p_cur
196*line 195
197clr.l _p_ctr
198*line 196
199clr.l _p_fwd
200*line 197
201clr.l _scp
202*line 199
203clr _curscor
204*line 200
205clr _cursect
206*line 202
207jsr _evleft
208bra L2
209L2:tst.l (sp)+
210movem.l (sp)+,R7-R7/R13-R13
211unlk R14
212rts
213.globl _e_clr
214.text
215_e_clr:
216~~e_clr:
217~e1=R13
218link R14,#0
219movem.l R7-R7/R13-R13,-(sp)
220*line 219
221move.l 8(R14),R13
222*line 219
223move.b 4(R13),R0
224ext.w R0
225bra L14
226*line 220
227L15:
228*line 221
229*line 222
230*line 223
231clr.l 24(R13)
232*line 224
233clr.l 28(R13)
234*line 225
235L16:
236*line 226
237*line 227
238*line 228
239clr.l 20(R13)
240*line 229
241clr.l 16(R13)
242*line 230
243L17:
244*line 231
245*line 232
246*line 233
247clr.l 12(R13)
248*line 234
249clr.l 8(R13)
250*line 235
251*line 236
252clr.l (R13)
253*line 237
254clr.b 5(R13)
255*line 238
256clr.b 6(R13)
257*line 239
258clr.b 7(R13)
259bra L13
260L14:cmp #5,R0
261beq L17
262cmp #6,R0
263beq L16
264cmp #8,R0
265beq L15
266bra L13
267L13:
268*line 242
269move.l R13,R0
270bra L12
271L12:tst.l (sp)+
272movem.l (sp)+,R13-R13
273unlk R14
274rts
275.globl _e_ins
276.text
277_e_ins:
278~~e_ins:
279~e1=R13
280~e2=R12
281link R14,#0
282movem.l R7-R7/R11-R13,-(sp)
283~t1=R11
284*line 261
285move.l 8(R14),R13
286*line 261
287move.l 12(R14),R12
288*line 261
289move.l 12(R12),R11
290*line 262
291move.l R11,12(R13)
292*line 263
293move.l R12,8(R13)
294*line 264
295move.l R13,12(R12)
296*line 265
297move.l R13,8(R11)
298*line 266
299move.l R13,R0
300bra L18
301L18:tst.l (sp)+
302movem.l (sp)+,R11-R13
303unlk R14
304rts
305.globl _e_rmv
306.text
307_e_rmv:
308~~e_rmv:
309~e1=R13
310link R14,#0
311movem.l R7-R7/R11-R13,-(sp)
312~t1=R12
313~t2=R11
314*line 282
315move.l 8(R14),R13
316*line 282
317move.l 8(R13),R12
318*line 283
319move.l 12(R13),R11
320*line 284
321move.l R11,12(R12)
322*line 285
323move.l R12,8(R11)
324*line 286
325clr.l 12(R13)
326*line 287
327clr.l 8(R13)
328*line 288
329move.l R13,R0
330bra L19
331L19:tst.l (sp)+
332movem.l (sp)+,R11-R13
333unlk R14
334rts
335.globl _e_alc
336.text
337_e_alc:
338~~e_alc:
339~w=8
340link R14,#0
341movem.l R7-R7/R12-R13,-(sp)
342~ev=R13
343~ex=R12
344*line 307
345move.b #1,_se_chg
346*line 309
347move 8(R14),R0
348bra L22
349*line 310
350L23:
351*line 311
352*line 312
353*line 313
354*line 313
355cmp.l #$5,_spcount
356bge L24
357*line 314
358*line 315
359*line 315
360tst.l _se1_cnt
361bne L25
362*line 316
363*line 317
364*line 317
365tst.l _se3_cnt
366beq L26
367*line 318
368*line 319
369move.l _size3,R12
370*line 320
371move.l 12(R12),_size3
372*line 321
373add.l #$1,_frags
374*line 322
375sub.l #$1,_se3_cnt
376*line 323
377move.b #5,4(R12)
378*line 324
379clr.l 12(R12)
380*line 325
381move.l R12,R0
382bra L20
383*line 326
384bra L27
385L26:
386*line 327
387*line 328
388*line 329
389*line 329
390tst.l _se2_cnt
391beq L28
392*line 330
393*line 331
394move.l _size2,R12
395*line 332
396move.l _size2,R8
397move.l 12(R8),_size2
398*line 333
399move.b #5,4(R12)
400*line 334
401clr.l 12(R12)
402*line 335
403add.l #$1,_frags
404*line 336
405sub.l #$1,_se2_cnt
406*line 337
407move.l R12,R0
408bra L20
409*line 338
410bra L29
411L28:
412*line 339
413*line 340
414*line 341
415clr.l R0
416bra L20
417L29:
418*line 342
419L27:
420*line 343
421*line 344
422*line 345
423bra L30
424L25:
425*line 346
426*line 347
427*line 348
428move.l _size1,R12
429*line 349
430move.l _size1,R8
431move.l 12(R8),_size1
432*line 350
433clr.l 12(R12)
434*line 351
435sub.l #$1,_se1_cnt
436*line 352
437move.l R12,R0
438bra L20
439L30:
440*line 353
441*line 354
442bra L31
443L24:
444*line 355
445*line 356
446*line 357
447move.l _pspool,R12
448*line 358
449add.l #20,_pspool
450*line 359
451sub.l #$5,_spcount
452*line 360
453move.b #5,4(R12)
454*line 361
455move.l R12,R0
456bra L20
457L31:
458*line 362
459*line 363
460*line 364
461*line 365
462*line 366
463L32:
464*line 367
465*line 368
466*line 369
467*line 369
468cmp.l #$6,_spcount
469bge L33
470*line 370
471*line 371
472*line 371
473tst.l _se2_cnt
474bne L34
475*line 372
476*line 373
477*line 373
478tst.l _se3_cnt
479beq L35
480*line 374
481*line 375
482move.l _size3,R12
483*line 376
484move.l _size3,R8
485move.l 12(R8),_size3
486*line 377
487move.b #6,4(R12)
488*line 378
489clr.l 12(R12)
490*line 379
491sub.l #$1,_se3_cnt
492*line 380
493add.l #$1,_frags
494*line 381
495move.l R12,R0
496bra L20
497*line 382
498bra L36
499L35:
500*line 383
501*line 384
502*line 385
503clr.l R0
504bra L20
505L36:
506*line 386
507*line 387
508bra L37
509L34:
510*line 388
511*line 389
512*line 390
513move.l _size2,R12
514*line 391
515move.l _size2,R8
516move.l 12(R8),_size2
517*line 392
518clr.l 12(R12)
519*line 393
520sub.l #$1,_se2_cnt
521*line 394
522move.l R12,R0
523bra L20
524L37:
525*line 395
526*line 396
527bra L38
528L33:
529*line 397
530*line 398
531*line 399
532move.l _pspool,R12
533*line 400
534add.l #24,_pspool
535*line 401
536sub.l #$6,_spcount
537*line 402
538move.b #6,4(R12)
539*line 403
540move.l R12,R0
541bra L20
542*line 404
543L38:
544*line 405
545*line 406
546*line 407
547*line 408
548*line 409
549L39:
550*line 410
551*line 411
552*line 412
553*line 412
554cmp.l #$8,_spcount
555bge L40
556*line 413
557*line 414
558*line 414
559tst.l _se3_cnt
560bne L41
561*line 415
562*line 416
563clr.l R0
564bra L20
565*line 417
566bra L42
567L41:
568*line 418
569*line 419
570*line 420
571move.l _size3,R12
572*line 421
573move.l _size3,R8
574move.l 12(R8),_size3
575*line 422
576clr.l 12(R12)
577*line 423
578sub.l #$1,_se3_cnt
579*line 424
580move.l R12,R0
581bra L20
582L42:
583*line 425
584*line 426
585bra L43
586L40:
587*line 427
588*line 428
589*line 429
590move.l _pspool,R12
591*line 430
592add.l #32,_pspool
593*line 431
594sub.l #$8,_spcount
595*line 432
596move.b #8,4(R12)
597*line 433
598move.l R12,R0
599bra L20
600L43:
601*line 434
602*line 435
603L44:
604*line 436
605*line 437
606*line 438
607clr.l R0
608bra L20
609bra L21
610L22:cmp #5,R0
611beq L23
612cmp #6,R0
613beq L32
614cmp #8,R0
615beq L39
616bra L44
617L21:
618*line 441
619clr.l R0
620bra L20
621L20:tst.l (sp)+
622movem.l (sp)+,R12-R13
623unlk R14
624rts
625.globl _e_del
626.text
627_e_del:
628~~e_del:
629~e1=R13
630link R14,#0
631movem.l R7-R7/R13-R13,-(sp)
632*line 458
633move.l 8(R14),R13
634*line 458
635move.l R13,(sp)
636jsr _e_clr
637*line 460
638move.b 4(R13),R0
639ext.w R0
640bra L47
641*line 461
642L48:
643*line 462
644*line 463
645*line 464
646move.l _size1,12(R13)
647*line 465
648move.l R13,_size1
649*line 466
650add.l #$1,_se1_cnt
651bra L46
652*line 467
653*line 468
654L49:
655*line 469
656*line 470
657*line 471
658move.l _size2,12(R13)
659*line 472
660move.l R13,_size2
661*line 473
662add.l #$1,_se2_cnt
663bra L46
664*line 474
665*line 475
666L50:
667*line 476
668*line 477
669*line 478
670move.l _size3,12(R13)
671*line 479
672move.l R13,_size3
673*line 480
674add.l #$1,_se3_cnt
675bra L46
676*line 481
677*line 482
678L51:
679*line 483
680*line 484
681move #1,R0
682bra L45
683bra L46
684L47:cmp #5,R0
685beq L48
686cmp #6,R0
687beq L49
688cmp #8,R0
689beq L50
690bra L51
691L46:
692*line 487
693move.b #1,_se_chg
694*line 488
695clr R0
696bra L45
697L45:tst.l (sp)+
698movem.l (sp)+,R13-R13
699unlk R14
700rts
701.globl _eh_ins
702.text
703_eh_ins:
704~~eh_ins:
705~ne=R13
706~et=12
707link R14,#0
708movem.l R7-R7/R11-R13,-(sp)
709~hp=R12
710~ep=R11
711*line 507
712move.l 8(R14),R13
713*line 507
714move _curscor,R0
715muls #48,R0
716move 12(R14),R1
717asl #2,R1
718ext.l R1
719add.l R1,R0
720add.l #_hplist,R0
721move.l R0,R8
722move.l (R8),R12
723*line 509
724*line 509
725move.l R12,R0
726bne L53
727*line 510
728*line 511
729move _curscor,R0
730muls #48,R0
731move 12(R14),R1
732asl #2,R1
733ext.l R1
734add.l R1,R0
735add.l #_hplist,R0
736move.l R0,R8
737move.l R13,(R8)
738*line 512
739clr.l 20(R13)
740*line 513
741clr.l 16(R13)
742bra L52
743*line 514
744*line 515
745*line 516
746L53:
747*line 517
748*line 517
749move.l (R12),R0
750cmp.l (R13),R0
751ble L54
752*line 518
753*line 519
754move.l R13,16(R12)
755*line 520
756move.l R12,20(R13)
757*line 521
758clr.l 16(R13)
759*line 522
760move _curscor,R0
761muls #48,R0
762move 12(R14),R1
763asl #2,R1
764ext.l R1
765add.l R1,R0
766add.l #_hplist,R0
767move.l R0,R8
768move.l R13,(R8)
769bra L52
770*line 523
771*line 524
772*line 525
773L54:
774*line 526
775bra L57
776L56:
777*line 527
778*line 528
779*line 528
780move.l (R11),R0
781cmp.l (R13),R0
782ble L58
783*line 529
784*line 530
785move.l R11,20(R13)
786*line 531
787move.l R12,16(R13)
788*line 532
789move.l R13,20(R12)
790*line 533
791move.l R13,16(R11)
792bra L52
793*line 534
794*line 535
795*line 536
796L58:
797*line 537
798move.l R11,R12
799L57:
800*line 538
801move.l 20(R12),R11
802move.l R11,R0
803bne L56
804L55:
805*line 540
806move.l R13,20(R12)
807*line 541
808clr.l 20(R13)
809*line 542
810move.l R12,16(R13)
811bra L52
812L52:tst.l (sp)+
813movem.l (sp)+,R11-R13
814unlk R14
815rts
816.globl _eh_rmv
817.text
818_eh_rmv:
819~~eh_rmv:
820~ev=R13
821~et=12
822link R14,#0
823movem.l R7-R7/R13-R13,-(sp)
824*line 560
825move.l 8(R14),R13
826*line 560
827*line 561
828move _curscor,R0
829muls #48,R0
830move 12(R14),R1
831asl #2,R1
832ext.l R1
833add.l R1,R0
834add.l #_hplist,R0
835move.l R0,R8
836cmp.l (R8),R13
837bne L60
838*line 561
839move _curscor,R0
840muls #48,R0
841move 12(R14),R1
842asl #2,R1
843ext.l R1
844add.l R1,R0
845add.l #_hplist,R0
846move.l R0,R8
847move.l 20(R13),(R8)
848*line 562
849L60:
850*line 563
851*line 564
852tst.l 20(R13)
853beq L61
854*line 564
855move.l 20(R13),R8
856move.l 16(R13),16(R8)
857*line 565
858L61:
859*line 566
860*line 567
861tst.l 16(R13)
862beq L62
863*line 567
864move.l 16(R13),R8
865move.l 20(R13),20(R8)
866*line 568
867L62:
868*line 569
869clr.l R0
870move.l R0,16(R13)
871move.l R0,20(R13)
872L59:tst.l (sp)+
873movem.l (sp)+,R13-R13
874unlk R14
875rts
876.globl _sc_clr
877.text
878_sc_clr:
879~~sc_clr:
880~ns=R7
881link R14,#0
882movem.l R5-R7/R12-R13,-(sp)
883~dsp=R13
884~nsp=R12
885~i=R6
886*line 587
887move 8(R14),R7
888*line 587
889*line 587
890move R7,R8
891add.l R8,R8
892add.l R8,R8
893add.l #_scores,R8
894move.l (R8),R12
895move.l R12,R0
896beq L64
897*line 588
898*line 589
899bra L67
900L66:
901*line 590
902*line 591
903move.l R12,(sp)
904jsr _e_rmv
905move.l R0,(sp)
906jsr _e_del
907*line 592
908move.l R13,R12
909*line 593
910L67:
911*line 594
912move.l 12(R12),R13
913cmp.l R13,R12
914bne L66
915L65:
916*line 595
917*line 596
918move.l R12,(sp)
919jsr _e_del
920*line 597
921*line 598
922L64:
923*line 599
924clr R6
925bra L70
926L71:
927*line 600
928move R7,R0
929muls #48,R0
930move R6,R1
931asl #2,R1
932ext.l R1
933add.l R1,R0
934add.l #_hplist,R0
935move.l R0,R8
936move.l #$0,(R8)
937L69:
938*line 599
939add #1,R6
940L70:
941*line 599
942cmp #12,R6
943blt L71
944L68:
945*line 602
946clr R6
947bra L74
948L75:
949*line 603
950*line 604
951move R7,R0
952muls #80,R0
953move R6,R1
954asl #2,R1
955ext.l R1
956add.l R1,R0
957add.l #_seclist,R0
958move.l R0,R8
959move.l #$0,(R8)
960*line 605
961move #12,(sp)
962clr -(sp)
963move R7,R0
964muls #240,R0
965add.l #_stimes,R0
966move.l R0,-(sp)
967jsr _memset
968addq.l #6,sp
969L73:
970*line 602
971add #1,R6
972L74:
973*line 602
974cmp #20,R6
975blt L75
976L72:
977*line 608
978move #16,(sp)
979move.l #L76,-(sp)
980move R7,R0
981asl #4,R0
982ext.l R0
983add.l #_scname,R0
984move.l R0,-(sp)
985jsr _memcpy
986addq.l #8,sp
987*line 610
988move R7,R8
989add.l R8,R8
990add.l R8,R8
991add.l #_scores,R8
992move.l #$0,(R8)
993L63:tst.l (sp)+
994movem.l (sp)+,R6-R7/R12-R13
995unlk R14
996rts
997.globl _selscor
998.text
999_selscor:
1000~~selscor:
1001~ns=R7
1002link R14,#0
1003movem.l R4-R7/R12-R13,-(sp)
1004~oldscor=R6
1005~grp=R5
1006~nsp=R13
1007~ep=R12
1008*line 629
1009move 8(R14),R7
1010*line 629
1011clr (sp)
1012jsr _clkset
1013*line 630
1014jsr _dsclk
1015*line 631
1016clr.l _fc_val
1017*line 632
1018clr _sd
1019*line 633
1020move _curscor,R6
1021*line 634
1022move R7,_curscor
1023*line 636
1024*line 636
1025move R7,R8
1026add.l R8,R8
1027add.l R8,R8
1028add.l #_scores,R8
1029move.l (R8),R13
1030move.l R13,R0
1031bne L78
1032*line 637
1033*line 638
1034*line 638
1035move #5,(sp)
1036jsr _e_alc
1037move.l R0,R13
1038move.l R13,R0
1039bne L79
1040*line 639
1041*line 640
1042move R6,_curscor
1043*line 641
1044move #-1,R0
1045bra L77
1046*line 642
1047*line 643
1048L79:
1049*line 644
1050move R7,R8
1051add.l R8,R8
1052add.l R8,R8
1053add.l #_scores,R8
1054move.l R13,(R8)
1055*line 645
1056move.l R13,12(R13)
1057*line 646
1058move.l R13,8(R13)
1059*line 647
1060move.b #1,5(R13)
1061*line 648
1062move.b R7,6(R13)
1063*line 649
1064clr.l (R13)
1065*line 650
1066*line 651
1067*line 651
1068move #5,(sp)
1069jsr _e_alc
1070move.l R0,R12
1071move.l R12,R0
1072bne L80
1073*line 652
1074*line 653
1075move R7,(sp)
1076jsr _sc_clr
1077*line 654
1078move R6,_curscor
1079*line 655
1080move #-1,R0
1081bra L77
1082*line 656
1083*line 657
1084L80:
1085*line 658
1086move.b #21,5(R12)
1087*line 659
1088move.b R7,6(R12)
1089*line 660
1090move.l R13,(sp)
1091move.l R12,-(sp)
1092jsr _e_ins
1093addq.l #4,sp
1094*line 661
1095move.l #$7fffffff,(R12)
1096*line 662
1097move R7,R8
1098add.l R8,R8
1099add.l R8,R8
1100add.l #_scores,R8
1101move.l (R8),R13
1102*line 663
1103move #16,(sp)
1104move.l #L81,-(sp)
1105move R7,R0
1106asl #4,R0
1107ext.l R0
1108add.l #_scname,R0
1109move.l R0,-(sp)
1110jsr _memcpy
1111addq.l #8,sp
1112*line 664
1113*line 665
1114L78:
1115*line 666
1116move.l R13,_scp
1117*line 667
1118move.l R13,_p_bak
1119*line 668
1120move.l R13,_p_cur
1121*line 669
1122move.l R13,_p_ctr
1123*line 670
1124move.l R13,_p_fwd
1125*line 671
1126clr _cursect
1127*line 672
1128clr.l (sp)
1129jsr _sc_goto
1130*line 673
1131clr R0
1132bra L77
1133L77:tst.l (sp)+
1134movem.l (sp)+,R5-R7/R12-R13
1135unlk R14
1136rts
1137.data
1138L11:.dc.b $7B,$20,$65,$6D,$70,$74,$79,$20,$73,$63,$6F,$72,$65,$20,$20,$7D,$0
1139L76:.dc.b $7B,$20,$65,$6D,$70,$74,$79,$20,$73,$63,$6F,$72,$65,$20,$20,$7D,$0
1140L81:.dc.b $25,$25,$25,$20,$55,$6E,$74,$69,$74,$6C,$65,$64,$20,$25,$25,$25,$0
Note: See TracBrowser for help on using the repository browser.