-
Notifications
You must be signed in to change notification settings - Fork 1
/
sprite.asm
892 lines (892 loc) · 22.9 KB
/
sprite.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
; uint : return_address_1 : $0334 (820)
; uint : return_address_2 : $0335 (821)
; uint : i : $0336 (822)
; uint : s : $0337 (823)
; Adding: return_address_1 of type: uint
; Adding: return_address_2 of type: uint
; RULE: datatype: int
.org $0834
; RULE: datatype: mob
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (192)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (224)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (224)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (248)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (248)
; RULE: value: NUMBER: (0)
; RULE: init: '=' expression
; RULE: statement: datatype ID init
; MOB sprite0=m
; NOT Adding: sprite0 of type: mob
; =========================================================
; New Scope (MOB)
LDA #$C0; 0834
STA $07F8; 0836
JSR LBL1L0; 0839
sprite0:
.BYTE #$00, #$60, #$00, #$00, #$E0, #$00, #$01, #$E0, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$01, #$F8, #$00, #$01, #$F8, #$00
LBL1L0:
PLA; 087B
STA $FB; 087C
PLA; 087E
STA $FC; 087F
INC $FB; 0881
LDA #$00; 0883
STA $FD; 0885
LDA #$30; 0887
STA $FE; 0889
JSR MOBCPY; 088B
; Release Scope MOB
; =========================================================
; RULE: datatype: mob
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (193)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (126)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (255)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (129)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (3)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (6)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (12)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (24)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (48)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (192)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (255)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (255)
; RULE: value: NUMBER: (128)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: init: '=' expression
; RULE: statement: datatype ID init
; MOB sprite1=m
; NOT Adding: sprite1 of type: mob
; =========================================================
; New Scope (MOB)
LDA #$C2; 088E
STA $07F9; 0890
JSR LBL1L1; 0893
sprite1:
.BYTE #$00, #$7E, #$00, #$00, #$FF, #$00, #$01, #$81, #$80, #$00, #$01, #$80, #$00, #$01, #$80, #$00, #$03, #$00, #$00, #$06, #$00, #$00, #$0C, #$00, #$00, #$18, #$00, #$00, #$30, #$00, #$00, #$60, #$00, #$00, #$C0, #$00, #$01, #$80, #$00, #$01, #$FF, #$80, #$01, #$FF, #$80, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00
LBL1L1:
PLA; 08D5
STA $FB; 08D6
PLA; 08D8
STA $FC; 08D9
INC $FB; 08DB
LDA #$80; 08DD
STA $FD; 08DF
LDA #$30; 08E1
STA $FE; 08E3
JSR MOBCPY; 08E5
; Release Scope MOB
; =========================================================
; RULE: datatype: mob
; RULE: value: NUMBER: (2)
; RULE: value: NUMBER: (194)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (192)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (2)
; RULE: value: NUMBER: (32)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (32)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (192)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (32)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (2)
; RULE: value: NUMBER: (32)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (1)
; RULE: value: NUMBER: (192)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: init: '=' expression
; RULE: statement: datatype ID init
; MOB sprite2=m
; NOT Adding: sprite2 of type: mob
; =========================================================
; New Scope (MOB)
LDA #$C4; 08E8
STA $07FA; 08EA
JSR LBL1L2; 08ED
sprite2:
.BYTE #$00, #$00, #$00, #$00, #$00, #$00, #$01, #$C0, #$00, #$02, #$20, #$00, #$00, #$20, #$00, #$00, #$C0, #$00, #$00, #$20, #$00, #$02, #$20, #$00, #$01, #$C0, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00
LBL1L2:
PLA; 092F
STA $FB; 0930
PLA; 0932
STA $FC; 0933
INC $FB; 0935
LDA #$00; 0937
STA $FD; 0939
LDA #$31; 093B
STA $FE; 093D
JSR MOBCPY; 093F
; Release Scope MOB
; =========================================================
; RULE: datatype: mob
; RULE: value: NUMBER: (3)
; RULE: value: NUMBER: (195)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (12)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (12)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (12)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (12)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (15)
; RULE: value: NUMBER: (248)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (15)
; RULE: value: NUMBER: (248)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (96)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: value: NUMBER: (0)
; RULE: init: '=' expression
; RULE: statement: datatype ID init
; MOB sprite3=m
; NOT Adding: sprite3 of type: mob
; =========================================================
; New Scope (MOB)
LDA #$C6; 0942
STA $07FB; 0944
JSR LBL1L3; 0947
sprite3:
.BYTE #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$60, #$00, #$0C, #$60, #$00, #$0C, #$60, #$00, #$0C, #$60, #$00, #$0C, #$60, #$00, #$0F, #$F8, #$00, #$0F, #$F8, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$60, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00
LBL1L3:
PLA; 0989
STA $FB; 098A
PLA; 098C
STA $FC; 098D
INC $FB; 098F
LDA #$80; 0991
STA $FD; 0993
LDA #$31; 0995
STA $FE; 0997
JSR MOBCPY; 0999
; Release Scope MOB
; =========================================================
; RULE: datatype: uint
; RULE: value: NUMBER: (0)
; RULE: expression: value: [u0)
; u0
; RULE: init: '=' expression
; else if( isInteger(u0)) - line 2263
LDA #$00; 099C
; RULE: statement: datatype ID init
; UINT i=A
; Adding: i of type: uint
STA $0336; ; 099E
; =========================================================
; New Scope (FOR)
LBL1L4:
; initialization goes here
PHA; 09A1
; RULE: value: NUMBER: (0)
; RULE: expression: value: [u0)
; u0
; RULE: init: '=' expression
; else if( isInteger(u0)) - line 2263
LDA #$00; 09A2
; RULE: statement: ID init
STA $0336; 09A4
; RULE: expression: ID : i
; RULE: value: NUMBER: (4)
; RULE: expression: value: [i4)
; i4
; =========================================================
; condition in FOR
; FOR $0336<i4
; =========================================================
LBL1L5: ; Top of FOR Loop
; Address Found
LDA $0336; 09A7
; $0336 vs. i4
CMP #$04; 09AA
.BYTE #$B0, #$03; 09AC
JMP LBL1L7; if c==0 jump to BODY; 09AE
JMP LBL1L8; jump out of FOR; 09B1
LBL1L6:
; RULE: expression: ID : i
; RULE: arithmetic ADD
; RULE: value: NUMBER: (1)
; RULE: expression: value: [i1)
; i1
; RULE: expression: expression arithmetic expression
; $0336 + i1
LDA $0336; 09B4
CLC; 09B7
ADC #$01; 09B8
; RULE: init: '=' expression
; RULE: statement: ID init
STA $0336; 09BA
JMP LBL1L5; jump to top of FOR; 09BD
LBL1L7:
; RULE: expression: ID : i
; RULE: value: NUMBER: (15)
; RULE: expression: value: [i15)
; i15
; statement: tSPRITECOLOUR '(' expression ',' expression ')' ';'
LDA #$0F; 09C0
STA $D35D; 09C2
JMP LBL1L6; jump to iterator ; 09C5
LBL1L8:
PLA; 09C8
; Release Scope FOR
; =========================================================
; RULE: value: NUMBER: (0)
; RULE: expression: value: [i0)
; i0
; RULE: value: NUMBER: (40)
; RULE: expression: value: [i40)
; i40
; RULE: value: NUMBER: (60)
; RULE: expression: value: [i60)
; i60
LDA #$28; 09C9
STA $D000; 09CB
LDA #$3C; 09CE
STA $D001; 09D0
; RULE: value: NUMBER: (1)
; RULE: expression: value: [i1)
; i1
; RULE: value: NUMBER: (80)
; RULE: expression: value: [i80)
; i80
; RULE: value: NUMBER: (60)
; RULE: expression: value: [i60)
; i60
LDA #$50; 09D3
STA $D002; 09D5
LDA #$3C; 09D8
STA $D003; 09DA
; RULE: value: NUMBER: (2)
; RULE: expression: value: [i2)
; i2
; RULE: value: NUMBER: (120)
; RULE: expression: value: [i120)
; i120
; RULE: value: NUMBER: (60)
; RULE: expression: value: [i60)
; i60
LDA #$78; 09DD
STA $D004; 09DF
LDA #$3C; 09E2
STA $D005; 09E4
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; RULE: value: NUMBER: (160)
; RULE: expression: value: [i160)
; i160
; RULE: value: NUMBER: (60)
; RULE: expression: value: [i60)
; i60
LDA #$A0; 09E7
STA $D006; 09E9
LDA #$3C; 09EC
STA $D007; 09EE
LDA #$0B; 09F1
STA $03; 09F3
LDA #$FF; 09F5
STA $02; 09F7
JSR PRN; 09F9
; RULE: value: NUMBER: (1)
; RULE: expression: value: [i1)
; i1
; statement: tSPRITEON '(' expression ')' ';'
LDA #$01; 09FC
ORA $D015; 09FE
STA $D015; 0A01
JSR LBL0L0; pressenter(); 0A04
; RULE: value: NUMBER: (2)
; RULE: expression: value: [i2)
; i2
; statement: tSPRITEON '(' expression ')' ';'
LDA #$02; 0A07
ORA $D015; 0A09
STA $D015; 0A0C
JSR LBL0L0; pressenter(); 0A0F
; RULE: value: NUMBER: (4)
; RULE: expression: value: [i4)
; i4
; statement: tSPRITEON '(' expression ')' ';'
LDA #$04; 0A12
ORA $D015; 0A14
STA $D015; 0A17
JSR LBL0L0; pressenter(); 0A1A
; RULE: value: NUMBER: (8)
; RULE: expression: value: [i8)
; i8
; statement: tSPRITEON '(' expression ')' ';'
LDA #$08; 0A1D
ORA $D015; 0A1F
STA $D015; 0A22
JSR LBL0L0; pressenter(); 0A25
; RULE: value: NUMBER: (4)
; RULE: expression: value: [i4)
; i4
; statement: tSPRITEOFF '(' expression ')' ';'
LDA #$04; 0A28
EOR #$FF; 0A2A
AND $D015; 0A2C
STA $D015; 0A2F
JSR LBL0L0; pressenter(); 0A32
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; statement: tSPRITEOFF '(' expression ')' ';'
LDA #$03; 0A35
EOR #$FF; 0A37
AND $D015; 0A39
STA $D015; 0A3C
JSR LBL0L0; pressenter(); 0A3F
LDA #$0C; 0A42
STA $03; 0A44
LDA #$15; 0A46
STA $02; 0A48
JSR PRN; 0A4A
; RULE: value: NUMBER: (10)
; RULE: expression: value: [i10)
; i10
; statement: tSPRITESET '(' expression ')' ';'
LDA #$0A; 0A4D
STA $D015; 0A4F
JSR LBL0L0; pressenter(); 0A52
; RULE: value: NUMBER: (5)
; RULE: expression: value: [i5)
; i5
; statement: tSPRITESET '(' expression ')' ';'
LDA #$05; 0A55
STA $D015; 0A57
JSR LBL0L0; pressenter(); 0A5A
; RULE: value: NUMBER: (15)
; RULE: expression: value: [i15)
; i15
; statement: tSPRITESET '(' expression ')' ';'
LDA #$0F; 0A5D
STA $D015; 0A5F
JSR LBL0L0; pressenter(); 0A62
LDA #$0C; 0A65
STA $03; 0A67
LDA #$20; 0A69
STA $02; 0A6B
JSR PRN; 0A6D
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA #$03; 0A70
EOR $D015; 0A72
STA $D015; 0A75
JSR LBL0L0; pressenter(); 0A78
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA #$03; 0A7B
EOR $D015; 0A7D
STA $D015; 0A80
JSR LBL0L0; pressenter(); 0A83
; RULE: value: NUMBER: (12)
; RULE: expression: value: [i12)
; i12
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA #$0C; 0A86
EOR $D015; 0A88
STA $D015; 0A8B
JSR LBL0L0; pressenter(); 0A8E
; RULE: value: NUMBER: (12)
; RULE: expression: value: [i12)
; i12
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA #$0C; 0A91
EOR $D015; 0A93
STA $D015; 0A96
JSR LBL0L0; pressenter(); 0A99
; RULE: value: NUMBER: (15)
; RULE: expression: value: [i15)
; i15
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA #$0F; 0A9C
EOR $D015; 0A9E
STA $D015; 0AA1
JSR LBL0L0; pressenter(); 0AA4
LDA #$0C; 0AA7
STA $03; 0AA9
LDA #$2E; 0AAB
STA $02; 0AAD
JSR PRN; 0AAF
JSR LBL0L0; pressenter(); 0AB2
LDA #$0C; 0AB5
STA $03; 0AB7
LDA #$42; 0AB9
STA $02; 0ABB
JSR PRN; 0ABD
; RULE: datatype: uint
; RULE: value: NUMBER: (1)
; RULE: expression: value: [u1)
; u1
; RULE: init: '=' expression
; else if( isInteger(u1)) - line 2263
LDA #$01; 0AC0
; RULE: statement: datatype ID init
; UINT s=A
; Adding: s of type: uint
STA $0337; ; 0AC2
; =========================================================
; New Scope (WHILE)
; WHILE LOOP
PHA; 0AC5
LBL1L9:
; RULE: expression: ID : s
; RULE: value: NUMBER: (9)
; RULE: expression: value: [u9)
; u9
; =========================================================
; condition in WHILE
; WHILE $0337<u9
; =========================================================
LBL1L10: ; Top of WHILE Loop
; Address Found
LDA $0337; 0AC6
; $0337 vs. u9
CMP #$09; 0AC9
.BYTE #$90, #$03; 0ACB
JMP LBL1L12; jump to ELSE; 0ACD
LBL1L11:
; RULE: expression: ID : s
; statement: tSPRITEON '(' expression ')' ';'
LDA $D015; 0AD0
ORA $0337; 0AD3
STA $D015; 0AD6
JSR LBL0L0; pressenter(); 0AD9
; RULE: expression: ID : s
ASL $0337; 0ADC
JMP LBL1L10; jump to top of FOR; 0ADF
LBL1L12:
PLA; 0AE2
; Release Scope WHILE
; =========================================================
; RULE: value: NUMBER: (4)
; RULE: expression: value: [u4)
; u4
; RULE: init: '=' expression
; else if( isInteger(u4)) - line 2263
LDA #$04; 0AE3
; RULE: statement: ID init
STA $0337; 0AE5
; RULE: expression: ID : s
; statement: tSPRITEOFF '(' expression ')' ';'
LDA $0337; 0AE8
EOR #$FF; 0AEB
AND $D015; 0AED
STA $D015; 0AF0
JSR LBL0L0; pressenter(); 0AF3
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; RULE: init: '=' expression
; else if( isInteger(i3)) - line 2263
LDA #$03; 0AF6
; RULE: statement: ID init
STA $0337; 0AF8
; RULE: expression: ID : s
; statement: tSPRITEOFF '(' expression ')' ';'
LDA $0337; 0AFB
EOR #$FF; 0AFE
AND $D015; 0B00
STA $D015; 0B03
JSR LBL0L0; pressenter(); 0B06
LDA #$0C; 0B09
STA $03; 0B0B
LDA #$58; 0B0D
STA $02; 0B0F
JSR PRN; 0B11
; RULE: value: NUMBER: (10)
; RULE: expression: value: [i10)
; i10
; RULE: init: '=' expression
; else if( isInteger(i10)) - line 2263
LDA #$0A; 0B14
; RULE: statement: ID init
STA $0337; 0B16
; RULE: expression: ID : s
; statement: tSPRITESET '(' expression ')' ';'
LDA $0337; 0B19
STA $D015; 0B1C
JSR LBL0L0; pressenter(); 0B1F
; RULE: value: NUMBER: (5)
; RULE: expression: value: [i5)
; i5
; RULE: init: '=' expression
; else if( isInteger(i5)) - line 2263
LDA #$05; 0B22
; RULE: statement: ID init
STA $0337; 0B24
; RULE: expression: ID : s
; statement: tSPRITESET '(' expression ')' ';'
LDA $0337; 0B27
STA $D015; 0B2A
JSR LBL0L0; pressenter(); 0B2D
; RULE: value: NUMBER: (15)
; RULE: expression: value: [i15)
; i15
; RULE: init: '=' expression
; else if( isInteger(i15)) - line 2263
LDA #$0F; 0B30
; RULE: statement: ID init
STA $0337; 0B32
; RULE: expression: ID : s
; statement: tSPRITESET '(' expression ')' ';'
LDA $0337; 0B35
STA $D015; 0B38
JSR LBL0L0; pressenter(); 0B3B
LDA #$0C; 0B3E
STA $03; 0B40
LDA #$63; 0B42
STA $02; 0B44
JSR PRN; 0B46
; RULE: value: NUMBER: (3)
; RULE: expression: value: [i3)
; i3
; RULE: init: '=' expression
; else if( isInteger(i3)) - line 2263
LDA #$03; 0B49
; RULE: statement: ID init
STA $0337; 0B4B
; RULE: expression: ID : s
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA $0337; 0B4E
EOR $D015; 0B51
STA $D015; 0B54
JSR LBL0L0; pressenter(); 0B57
; RULE: expression: ID : s
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA $0337; 0B5A
EOR $D015; 0B5D
STA $D015; 0B60
JSR LBL0L0; pressenter(); 0B63
; RULE: value: NUMBER: (12)
; RULE: expression: value: [i12)
; i12
; RULE: init: '=' expression
; else if( isInteger(i12)) - line 2263
LDA #$0C; 0B66
; RULE: statement: ID init
STA $0337; 0B68
; RULE: expression: ID : s
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA $0337; 0B6B
EOR $D015; 0B6E
STA $D015; 0B71
JSR LBL0L0; pressenter(); 0B74
; RULE: expression: ID : s
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA $0337; 0B77
EOR $D015; 0B7A
STA $D015; 0B7D
JSR LBL0L0; pressenter(); 0B80
; RULE: value: NUMBER: (15)
; RULE: expression: value: [i15)
; i15
; RULE: init: '=' expression
; else if( isInteger(i15)) - line 2263
LDA #$0F; 0B83
; RULE: statement: ID init
STA $0337; 0B85
; RULE: expression: ID : s
; statement: tSPRITETOGGLE '(' expression ')' ';'
LDA $0337; 0B88
EOR $D015; 0B8B
STA $D015; 0B8E
LDA #$0C; 0B91
STA $03; 0B93
LDA #$71; 0B95
STA $02; 0B97
JSR PRN; 0B99
; RULE: return: RETURN {} ';'
RTS; 0B9C
; RULE: datatype: int
LBL0L0:
JSR SCANF; 0B9D
; RULE: return: RETURN {} ';'
RTS; 0BA0
MOBCPY: ; Copy 63 bytes from $FB/$FC to $FD/$FE
LDY #$3F; 0BA1
MOBCPL1:
CPY #$00; 0BA3
BEQ MOBCPL2; 0BA5
LDA ($FB),Y; 0BA7
STA ($FD),Y; 0BA9
DEY; 0BAB
JMP MOBCPL1; 0BAC
MOBCPL2:
RTS; 0BAF
PRN:
LDY #$00; 0BB0
PRN_LOOP:
LDA ($02),Y; 0BB2
CMP #$00; 0BB4
BEQ PRN_END; 0BB6
JSR $FFD2; 0BB8
INY; 0BBB
JMP PRN_LOOP; 0BBC
PRN_END:
RTS; 0BBF
SCANF:
LDX #$00; 0BC0
STX $CFDE; 0BC2
SCANFTOP:
JSR $FF9F; 0BC5
JSR $FFE4; 0BC8
BEQ SCANFTOP; 0BCB
CMP #$0D; 0BCD
BEQ SCANFEND; 0BCF
CMP #$14; 0BD1
BEQ BKSPC; 0BD3
JSR $FFD2; 0BD5
LDX $CFDE; 0BD8
STA $CFE0,X; 0BDB
INX; 0BDE
STX $CFDE; 0BDF
CPX #$10; 0BE2
BEQ SCANFEND; 0BE4
JMP SCANFTOP; 0BE6
SCANFEND:
RTS; 0BE9
BKSPC:
LDX $CFDF; 0BEA
DEX; 0BED
STX $CFDF; 0BEE
JMP SCANFTOP; 0BF1
GETKEY:
JSR $FFE4; 0BF4
CMP #$00; 0BF7
BEQ GETKEY; 0BF9
STA $CFDF; 0BFB
RTS; 0BFE
; $bff "SPRITEON & SPRITEOFF\n"
STRLBL0:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$4F, #$4E, #$20, #$26, #$20, #$53, #$50, #$52, #$49, #$54, #$45, #$4F, #$46, #$46, #$0D, #$00
; $c15 "SPRITESET\n"
STRLBL1:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$53, #$45, #$54, #$0D, #$00
; $c20 "SPRITETOGGLE\n"
STRLBL2:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$54, #$4F, #$47, #$47, #$4C, #$45, #$0D, #$00
; $c2e "NOW WITH VARIABLES\n"
STRLBL3:
.BYTE #$4E, #$4F, #$57, #$20, #$57, #$49, #$54, #$48, #$20, #$56, #$41, #$52, #$49, #$41, #$42, #$4C, #$45, #$53, #$0D, #$00
; $c42 "SPRITEON & SPRITEOFF\n"
STRLBL4:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$4F, #$4E, #$20, #$26, #$20, #$53, #$50, #$52, #$49, #$54, #$45, #$4F, #$46, #$46, #$0D, #$00
; $c58 "SPRITESET\n"
STRLBL5:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$53, #$45, #$54, #$0D, #$00
; $c63 "SPRITETOGGLE\n"
STRLBL6:
.BYTE #$53, #$50, #$52, #$49, #$54, #$45, #$54, #$4F, #$47, #$47, #$4C, #$45, #$0D, #$00
; $c71 "DONE\n"
STRLBL7:
.BYTE #$44, #$4F, #$4E, #$45, #$0D, #$00