-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcc.asm
12473 lines (12398 loc) · 343 KB
/
cc.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
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; z80dasm 1.1.4
; command line: z80dasm -a -t -l -g 25200 -b blocks.txt code.bin
; ROM routines
ROM_PrintAFlashingCharacter: equ 018c1h
ROM_KeyboardScanning: equ 0028eh
ROM_InputAD: equ 015e6h
ROM_SABytes: equ 004c2h
; This subroutine is called to save the header information and later the actual program/data block to tape.
ROM_LDBytes: equ 00556h
; This subroutine is called to load the header information and later load or verify an actual block of data from a tape.
ROM_Cls: equ 00d6bh
ROM_ChanOpen: equ 01601h
ROM_SkipOver: equ 0007dh
; system variables
SYSVAR_ATTR_P: equ 05c8dh ; Permanent current colours
SYSVAR_LAST_K: equ 05c08h ; Last key pressed
SYSVAR_ERR_SP: equ 05c3dh ; Address of item on machine stack to use as error return
SYSVAR_MICRODRIVE_HD_11: equ 05cedh ; Microdrive - Line number
SYSVAR_MICRODRIVE_D_STR1: equ 05cd6h ; Microdrive - Start of 8 byte file specifier
SYSVAR_MICRODRIVE_START_OF_FILE_NAME: equ 05cdch ; Microdrive - Start of file name
SYSVAR_MICRODRIVE_N_STR1: equ 05cdah ; Length of file name
SYSVAR_ATTR_T: equ 05c8fh ; Temporary current colours
SYSVAR_MASK_T: equ 05c90h ; Temporary transparent colours
programStartAddress: equ 06270h ; 252000 dec
stackTopAddress: equ 06268h ; 252000 dec
org programStartAddress
programStart:
jp setStackTopAndRun ;6270 c3 80 74 . . t
l6273h:
jp setStackTopAndRun ;6273 c3 80 74 . . t
sub_6276h: ;tag=compileReal
jp l6ad2h ;6276 c3 d2 6a . . j
sub_6279h: ;tag=compileReal
jp l69c6h ;6279 c3 c6 69 . . i
sub_627ch:
jp l6976h ;627c c3 76 69 . v i
sub_627fh: ;tag=compileReal
jp l6a77h ;627f c3 77 6a . w j
sub_6282h:
jp l68b5h ;6282 c3 b5 68 . . h
sub_6285h:
jp l6943h ;6285 c3 43 69 . C i
jp setStackTopAndRun ;6288 c3 80 74 . . t
jp l6955h ;628b c3 55 69 . U i
sub_628eh:
jp l6820h ;628e c3 20 68 . h
jp l68cdh ;6291 c3 cd 68 . . h
sub_6294h:
jp l6abch ;6294 c3 bc 6a . . j
sub_6297h:
jp l695fh ;6297 c3 5f 69 . _ i
sub_629ah:
jp l6a65h ;629a c3 65 6a . e j
sub_629dh:
jp l7741h ;629d c3 41 77 . A w
sub_62a0h: ;tag=compileReal
jp l6920h ;62a0 c3 20 69 . i
sub_62a3h:
jp l6922h ;62a3 c3 22 69 . " i
l62a6h: ;tag=compileReal
jp l68d1h ;62a6 c3 d1 68 . . h
l62a9h:
jp l6867h ;62a9 c3 67 68 . g h
sub_62ach:
cp 030h ;62ac fe 30 . 0
ccf ;62ae 3f ?
ret nc ;62af d0 .
cp 03ah ;62b0 fe 3a . :
ret ;62b2 c9 .
ld a,l ;62b3 7d }
or e ;62b4 b3 .
ld l,a ;62b5 6f o
ld a,h ;62b6 7c |
or d ;62b7 b2 .
ld h,a ;62b8 67 g
ret ;62b9 c9 .
ld a,l ;62ba 7d }
xor e ;62bb ab .
ld l,a ;62bc 6f o
ld a,h ;62bd 7c |
xor d ;62be aa .
ld h,a ;62bf 67 g
ret ;62c0 c9 .
ld a,l ;62c1 7d }
and e ;62c2 a3 .
ld l,a ;62c3 6f o
ld a,h ;62c4 7c |
and d ;62c5 a2 .
ld h,a ;62c6 67 g
ret ;62c7 c9 .
l62c8h:
dec e ;62c8 1d .
ret m ;62c9 f8 .
add hl,hl ;62ca 29 )
jr l62c8h ;62cb 18 fb . .
l62cdh:
dec e ;62cd 1d .
ret m ;62ce f8 .
srl h ;62cf cb 3c . <
rr l ;62d1 cb 1d . .
jr l62cdh ;62d3 18 f8 . .
l62d5h:
dec e ;62d5 1d .
ret m ;62d6 f8 .
sra h ;62d7 cb 2c . ,
rr l ;62d9 cb 1d . .
jr l62d5h ;62db 18 f8 . .
sub_62ddh:
dec hl ;62dd 2b +
ld a,h ;62de 7c |
cpl ;62df 2f /
ld h,a ;62e0 67 g
ld a,l ;62e1 7d }
cpl ;62e2 2f /
ld l,a ;62e3 6f o
ret ;62e4 c9 .
ld a,h ;62e5 7c |
or l ;62e6 b5 .
ld hl,00000h ;62e7 21 00 00 ! . .
ret nz ;62ea c0 .
inc hl ;62eb 23 #
ret ;62ec c9 .
ld a,h ;62ed 7c |
xor d ;62ee aa .
push af ;62ef f5 .
xor h ;62f0 ac .
call m,sub_632bh ;62f1 fc 2b 63 . + c
ld a,h ;62f4 7c |
or a ;62f5 b7 .
call m,sub_62ddh ;62f6 fc dd 62 . . b
call sub_6300h ;62f9 cd 00 63 . . c
pop af ;62fc f1 .
ret p ;62fd f0 .
jr sub_62ddh ;62fe 18 dd . .
sub_6300h: ;tag=compileReal
push bc ;6300 c5 .
ld b,010h ;6301 06 10 . .
ld a,h ;6303 7c |
ld c,l ;6304 4d M
ld hl,00000h ;6305 21 00 00 ! . .
l6308h: ;tag=compileReal
add hl,hl ;6308 29 )
jr c,l6315h ;6309 38 0a 8 .
rl c ;630b cb 11 . .
rla ;630d 17 .
jr nc,l6313h ;630e 30 03 0 .
add hl,de ;6310 19 .
jr c,l6315h ;6311 38 02 8 .
l6313h: ;tag=compileReal
djnz l6308h ;6313 10 f3 . .
l6315h: ;tag=compileReal
pop bc ;6315 c1 .
ret ;6316 c9 .
sub_6317h:
ld a,h ;6317 7c |
xor d ;6318 aa .
push af ;6319 f5 .
xor h ;631a ac .
call m,sub_632bh ;631b fc 2b 63 . + c
ld a,h ;631e 7c |
or a ;631f b7 .
call m,sub_62ddh ;6320 fc dd 62 . . b
call sub_6331h ;6323 cd 31 63 . 1 c
pop af ;6326 f1 .
ret p ;6327 f0 .
call sub_62ddh ;6328 cd dd 62 . . b
sub_632bh:
ex de,hl ;632b eb .
call sub_62ddh ;632c cd dd 62 . . b
ex de,hl ;632f eb .
ret ;6330 c9 .
sub_6331h:
push bc ;6331 c5 .
ld b,d ;6332 42 B
ld c,e ;6333 4b K
ld de,00000h ;6334 11 00 00 . . .
ld a,010h ;6337 3e 10 > .
l6339h:
add hl,hl ;6339 29 )
jr c,l6342h ;633a 38 06 8 .
dec a ;633c 3d =
jr nz,l6339h ;633d 20 fa .
pop bc ;633f c1 .
ret ;6340 c9 .
l6341h:
add hl,hl ;6341 29 )
l6342h:
push af ;6342 f5 .
rl e ;6343 cb 13 . .
rl d ;6345 cb 12 . .
ld a,e ;6347 7b {
sub c ;6348 91 .
ld a,d ;6349 7a z
sbc a,b ;634a 98 .
jp m,l6353h ;634b fa 53 63 . S c
ld d,a ;634e 57 W
ld a,e ;634f 7b {
sub c ;6350 91 .
ld e,a ;6351 5f _
inc l ;6352 2c ,
l6353h:
pop af ;6353 f1 .
dec a ;6354 3d =
jr nz,l6341h ;6355 20 ea .
pop bc ;6357 c1 .
ret ;6358 c9 .
call sub_6317h ;6359 cd 17 63 . . c
ex de,hl ;635c eb .
ret ;635d c9 .
call sub_6331h ;635e cd 31 63 . 1 c
ex de,hl ;6361 eb .
ret ;6362 c9 .
sub_6363h: ;tag=compileReal
xor a ;6363 af .
sbc hl,de ;6364 ed 52 . R
ld h,a ;6366 67 g
ld l,a ;6367 6f o
ret ;6368 c9 .
sub_6369h:
call sub_6363h ;6369 cd 63 63 . c c
scf ;636c 37 7
inc hl ;636d 23 #
ret z ;636e c8 .
ccf ;636f 3f ?
dec hl ;6370 2b +
ret ;6371 c9 .
sub_6372h:
call sub_6363h ;6372 cd 63 63 . c c
ret z ;6375 c8 .
inc hl ;6376 23 #
scf ;6377 37 7
ret ;6378 c9 .
ex de,hl ;6379 eb .
sub_637ah:
call sub_6372h ;637a cd 72 63 . r c
ret z ;637d c8 .
jp m,l6384h ;637e fa 84 63 . . c
ret pe ;6381 e8 .
dec hl ;6382 2b +
ccf ;6383 3f ?
l6384h:
ret po ;6384 e0 .
dec hl ;6385 2b +
ccf ;6386 3f ?
ret ;6387 c9 .
ex de,hl ;6388 eb .
call sub_637ah ;6389 cd 7a 63 . z c
ret nz ;638c c0 .
inc hl ;638d 23 #
scf ;638e 37 7
ret ;638f c9 .
sub_6390h:
ex de,hl ;6390 eb .
sub_6391h: ;tag=compileReal
call sub_6363h ;6391 cd 63 63 . c c
ret nc ;6394 d0 .
inc hl ;6395 23 #
ret ;6396 c9 .
sub_6397h: ;tag=compileReal
ex de,hl ;6397 eb .
sub_6398h: ;tag=compileReal
call sub_6391h ;6398 cd 91 63 . . c
ret nz ;639b c0 .
inc hl ;639c 23 #
scf ;639d 37 7
ret ;639e c9 .
sub_639fh:
pop af ;639f f1 .
pop hl ;63a0 e1 .
pop de ;63a1 d1 .
push hl ;63a2 e5 .
push af ;63a3 f5 .
ld hl,00000h ;63a4 21 00 00 ! . .
ld a,e ;63a7 7b {
ret ;63a8 c9 .
call sub_639fh ;63a9 cd 9f 63 . . c
call sub_62ach ;63ac cd ac 62 . . b
ret nc ;63af d0 .
inc hl ;63b0 23 #
ret ;63b1 c9 .
call sub_639fh ;63b2 cd 9f 63 . . c
call sub_63beh ;63b5 cd be 63 . . c
ret c ;63b8 d8 .
jr l63cah ;63b9 18 0f . .
call sub_639fh ;63bb cd 9f 63 . . c
sub_63beh:
cp 041h ;63be fe 41 . A
ccf ;63c0 3f ?
ret nc ;63c1 d0 .
cp 05bh ;63c2 fe 5b . [
ret nc ;63c4 d0 .
inc hl ;63c5 23 #
ret ;63c6 c9 .
call sub_639fh ;63c7 cd 9f 63 . . c
l63cah:
add a,0e0h ;63ca c6 e0 . .
jr sub_63beh ;63cc 18 f0 . .
call sub_639fh ;63ce cd 9f 63 . . c
call sub_63d7h ;63d1 cd d7 63 . . c
ret nz ;63d4 c0 .
inc hl ;63d5 23 #
ret ;63d6 c9 .
sub_63d7h:
cp 020h ;63d7 fe 20 .
ret z ;63d9 c8 .
cp 00ah ;63da fe 0a . .
ret z ;63dc c8 .
cp 009h ;63dd fe 09 . .
ret ;63df c9 .
call sub_639fh ;63e0 cd 9f 63 . . c
call sub_63beh ;63e3 cd be 63 . . c
ex de,hl ;63e6 eb .
ret nc ;63e7 d0 .
add a,020h ;63e8 c6 20 .
ld l,a ;63ea 6f o
ret ;63eb c9 .
call sub_639fh ;63ec cd 9f 63 . . c
call l63cah ;63ef cd ca 63 . . c
ex de,hl ;63f2 eb .
ret nc ;63f3 d0 .
ld l,a ;63f4 6f o
ret ;63f5 c9 .
pop af ;63f6 f1 .
pop bc ;63f7 c1 .
pop de ;63f8 d1 .
pop hl ;63f9 e1 .
push af ;63fa f5 .
l63fbh:
ld a,(de) ;63fb 1a .
ldi ;63fc ed a0 . .
dec hl ;63fe 2b +
ld (hl),a ;63ff 77 w
inc hl ;6400 23 #
ret po ;6401 e0 .
jr l63fbh ;6402 18 f7 . .
sub_6404h: ;tag=compileReal
pop af ;6404 f1 .
pop bc ;6405 c1 .
pop hl ;6406 e1 .
pop de ;6407 d1 .
push af ;6408 f5 .
ld a,b ;6409 78 x
or c ;640a b1 .
ret z ;640b c8 .
sbc hl,de ;640c ed 52 . R
add hl,de ;640e 19 .
jr c,l6414h ;640f 38 03 8 .
ldir ;6411 ed b0 . .
ret ;6413 c9 .
l6414h: ;tag=compileReal
dec bc ;6414 0b .
add hl,bc ;6415 09 .
ex de,hl ;6416 eb .
add hl,bc ;6417 09 .
ex de,hl ;6418 eb .
inc bc ;6419 03 .
lddr ;641a ed b8 . .
ret ;641c c9 .
var_l641dh:
defb 0xdd, 0xe5, 0xc1, 0x09
sub_6421h:
ld a,(hl) ;6421 7e ~
inc hl ;6422 23 #
ld h,(hl) ;6423 66 f
ld l,a ;6424 6f o
ret ;6425 c9 .
sub_6426h:
push ix ;6426 dd e5 . .
pop bc ;6428 c1 .
add hl,bc ;6429 09 .
ld l,(hl) ;642a 6e n
ld h,000h ;642b 26 00 & .
ret ;642d c9 .
sub_642eh:
push ix ;642e dd e5 . .
pop bc ;6430 c1 .
ex de,hl ;6431 eb .
add hl,bc ;6432 09 .
ld (hl),e ;6433 73 s
inc hl ;6434 23 #
ld (hl),d ;6435 72 r
ex de,hl ;6436 eb .
ret ;6437 c9 .
sub_6438h:
push ix ;6438 dd e5 . .
pop bc ;643a c1 .
ex de,hl ;643b eb .
add hl,bc ;643c 09 .
ld (hl),e ;643d 73 s
ex de,hl ;643e eb .
ret ;643f c9 .
l6440h:
pop de ;6440 d1 .
ex de,hl ;6441 eb .
ex (sp),hl ;6442 e3 .
ld (hl),e ;6443 73 s
inc hl ;6444 23 #
ld (hl),d ;6445 72 r
ex de,hl ;6446 eb .
ret ;6447 c9 .
l6448h:
ld bc,00001h ;6448 01 01 00 . . .
l644bh:
ld e,(hl) ;644b 5e ^
inc hl ;644c 23 #
ld d,(hl) ;644d 56 V
ex de,hl ;644e eb .
add hl,bc ;644f 09 .
ex de,hl ;6450 eb .
ld (hl),d ;6451 72 r
dec hl ;6452 2b +
ld (hl),e ;6453 73 s
ex de,hl ;6454 eb .
ret ;6455 c9 .
l6456h:
ld bc,00001h ;6456 01 01 00 . . .
l6459h:
ld e,(hl) ;6459 5e ^
inc hl ;645a 23 #
ld d,(hl) ;645b 56 V
push de ;645c d5 .
ex de,hl ;645d eb .
add hl,bc ;645e 09 .
ex de,hl ;645f eb .
ld (hl),d ;6460 72 r
dec hl ;6461 2b +
ld (hl),e ;6462 73 s
pop hl ;6463 e1 .
ret ;6464 c9 .
sub_6465h:
ex de,hl ;6465 eb .
pop hl ;6466 e1 .
call sub_6421h ;6467 cd 21 64 . ! d
l646ah:
ld c,(hl) ;646a 4e N
inc hl ;646b 23 #
ld b,(hl) ;646c 46 F
inc hl ;646d 23 #
ld a,b ;646e 78 x
or c ;646f b1 .
jr z,l647eh ;6470 28 0c ( .
ld a,(hl) ;6472 7e ~
inc hl ;6473 23 #
cp e ;6474 bb .
ld a,(hl) ;6475 7e ~
inc hl ;6476 23 #
jr nz,l646ah ;6477 20 f1 .
cp d ;6479 ba .
jr nz,l646ah ;647a 20 ee .
ld h,b ;647c 60 `
ld l,c ;647d 69 i
l647eh:
jp (hl) ;647e e9 .
l647fh:
ld hl,00000h ;647f 21 00 00 ! . .
pop de ;6482 d1 .
push ix ;6483 dd e5 . .
ld ix,00000h ;6485 dd 21 00 00 . ! . .
add ix,sp ;6489 dd 39 . 9
add hl,sp ;648b 39 9
ld sp,hl ;648c f9 .
ld hl,(l6870h) ;648d 2a 70 68 * p h
add hl,sp ;6490 39 9
jr nc,l6495h ;6491 30 02 0 .
ex de,hl ;6493 eb .
jp (hl) ;6494 e9 .
l6495h:
ld hl,l64a3h ;6495 21 a3 64 ! . d
push hl ;6498 e5 .
ld hl,00004h ;6499 21 04 00 ! . .
push hl ;649c e5 .
call sub_653dh ;649d cd 3d 65 . = e
jp programStart ;64a0 c3 70 62 . p b
l64a3h:
defb "stack overflow", 0
l64b2h:
ld e,(ix+004h) ;64b2 dd 5e 04 . ^ .
ld d,(ix+005h) ;64b5 dd 56 05 . V .
jr l64bdh ;64b8 18 03 . .
l64bah:
ld de,00000h ;64ba 11 00 00 . . .
l64bdh:
ld sp,ix ;64bd dd f9 . .
pop ix ;64bf dd e1 . .
pop bc ;64c1 c1 .
ex de,hl ;64c2 eb .
add hl,sp ;64c3 39 9
ld sp,hl ;64c4 f9 .
ex de,hl ;64c5 eb .
push bc ;64c6 c5 .
ld b,h ;64c7 44 D
ld c,l ;64c8 4d M
ret ;64c9 c9 .
add hl,de ;64ca 19 .
ret ;64cb c9 .
or a ;64cc b7 .
sbc hl,de ;64cd ed 52 . R
ret ;64cf c9 .
sub_64d0h:
ld hl,00000h ;64d0 21 00 00 ! . .
l64d3h:
ld a,(de) ;64d3 1a .
call sub_62ach ;64d4 cd ac 62 . . b
ret nc ;64d7 d0 .
sub 030h ;64d8 d6 30 . 0
inc de ;64da 13 .
push de ;64db d5 .
add hl,hl ;64dc 29 )
ld e,l ;64dd 5d ]
ld d,h ;64de 54 T
add hl,hl ;64df 29 )
add hl,hl ;64e0 29 )
add hl,de ;64e1 19 .
ld e,a ;64e2 5f _
ld d,000h ;64e3 16 00 . .
add hl,de ;64e5 19 .
pop de ;64e6 d1 .
jr l64d3h ;64e7 18 ea . .
sub_64e9h:
push de ;64e9 d5 .
l64eah:
ld e,c ;64ea 59 Y
ld d,b ;64eb 50 P
call sub_6331h ;64ec cd 31 63 . 1 c
ex (sp),hl ;64ef e3 .
ld a,e ;64f0 7b {
add a,030h ;64f1 c6 30 . 0
cp 03ah ;64f3 fe 3a . :
jr c,l64f9h ;64f5 38 02 8 .
add a,007h ;64f7 c6 07 . .
l64f9h:
dec hl ;64f9 2b +
ld (hl),a ;64fa 77 w
ex (sp),hl ;64fb e3 .
ld a,l ;64fc 7d }
or h ;64fd b4 .
jr nz,l64eah ;64fe 20 ea .
pop hl ;6500 e1 .
ret ;6501 c9 .
sub_6502h:
push hl ;6502 e5 .
bit 7,h ;6503 cb 7c . |
jr z,l650ah ;6505 28 03 ( .
call sub_62ddh ;6507 cd dd 62 . . b
l650ah:
call sub_64e9h ;650a cd e9 64 . . d
pop de ;650d d1 .
bit 7,d ;650e cb 7a . z
ret z ;6510 c8 .
dec hl ;6511 2b +
ld (hl),02dh ;6512 36 2d 6 -
ret ;6514 c9 .
l6515h:
push hl ;6515 e5 .
ld hl,(l6cd1h) ;6516 2a d1 6c * . l
ld (hl),a ;6519 77 w
inc hl ;651a 23 #
ld (l6cd1h),hl ;651b 22 d1 6c " . l
pop hl ;651e e1 .
ret ;651f c9 .
l6520h:
push hl ;6520 e5 .
push de ;6521 d5 .
push bc ;6522 c5 .
ld l,a ;6523 6f o
push hl ;6524 e5 .
ld hl,(l6cd1h) ;6525 2a d1 6c * . l
push hl ;6528 e5 .
call sub_627ch ;6529 cd 7c 62 . | b
pop bc ;652c c1 .
pop de ;652d d1 .
pop hl ;652e e1 .
ret ;652f c9 .
ld hl,l6515h ;6530 21 15 65 ! . e
jr l6538h ;6533 18 03 . .
ld hl,l6520h ;6535 21 20 65 ! e
l6538h:
call sub_664fh ;6538 cd 4f 66 . O f
jr l6548h ;653b 18 0b . .
sub_653dh:
ld hl,l62a6h ;653d 21 a6 62 ! . b
ld (l6ccfh),hl ;6540 22 cf 6c " . l
pop de ;6543 d1 .
pop hl ;6544 e1 .
push hl ;6545 e5 .
push de ;6546 d5 .
add hl,sp ;6547 39 9
l6548h:
push bc ;6548 c5 .
ld e,(hl) ;6549 5e ^
inc hl ;654a 23 #
ld d,(hl) ;654b 56 V
dec hl ;654c 2b +
dec hl ;654d 2b +
push hl ;654e e5 .
ld a,0c3h ;654f 3e c3 > .
ld (l6cceh),a ;6551 32 ce 6c 2 . l
l6554h:
ld a,(de) ;6554 1a .
inc de ;6555 13 .
or a ;6556 b7 .
jr z,l6568h ;6557 28 0f ( .
cp 025h ;6559 fe 25 . %
jr nz,l6563h ;655b 20 06 .
ld a,(de) ;655d 1a .
cp 025h ;655e fe 25 . %
jr nz,l6574h ;6560 20 12 .
inc de ;6562 13 .
l6563h:
call l6cceh ;6563 cd ce 6c . . l
jr l6554h ;6566 18 ec . .
l6568h:
ld hl,(l6ccfh) ;6568 2a cf 6c * . l
ld a,015h ;656b 3e 15 > .
sub l ;656d 95 .
call z,l6515h ;656e cc 15 65 . . e
jp l6729h ;6571 c3 29 67 . ) g
l6574h:
push de ;6574 d5 .
ld hl,00620h ;6575 21 20 06 ! .
ld (l6cbfh),hl ;6578 22 bf 6c " . l
xor a ;657b af .
ld l,a ;657c 6f o
ld h,a ;657d 67 g
ld (l6cbfh+2),hl ;657e 22 c1 6c " . l
ld a,(de) ;6581 1a .
cp 02dh ;6582 fe 2d . -
ld a,001h ;6584 3e 01 > .
jr nz,l658ah ;6586 20 02 .
xor a ;6588 af .
inc de ;6589 13 .
l658ah:
ld (06cbeh),a ;658a 32 be 6c 2 . l
ld a,(de) ;658d 1a .
cp 030h ;658e fe 30 . 0
jr nz,l6597h ;6590 20 05 .
inc de ;6592 13 .
ld (l6cbfh),a ;6593 32 bf 6c 2 . l
ld a,(de) ;6596 1a .
l6597h:
call sub_62ach ;6597 cd ac 62 . . b
jr nc,l659fh ;659a 30 03 0 .
call sub_64d0h ;659c cd d0 64 . . d
l659fh:
ld (l6cc2h+1),hl ;659f 22 c3 6c " . l
ld a,(de) ;65a2 1a .
cp 02eh ;65a3 fe 2e . .
jr nz,l65b1h ;65a5 20 0a .
ld (l6cc2h),a ;65a7 32 c2 6c 2 . l
inc de ;65aa 13 .
call sub_64d0h ;65ab cd d0 64 . . d
ld (l6cbfh+1),hl ;65ae 22 c0 6c " . l
l65b1h:
call sub_6664h ;65b1 cd 64 66 . d f
ld hl,l6ccdh ;65b4 21 cd 6c ! . l
push af ;65b7 f5 .
ld (hl),b ;65b8 70 p
ex de,hl ;65b9 eb .
cp 064h ;65ba fe 64 . d
jr z,l65ddh ;65bc 28 1f ( .
cp 075h ;65be fe 75 . u
jr z,l65eah ;65c0 28 28 ( (
dec bc ;65c2 0b .
dec bc ;65c3 0b .
cp 06fh ;65c4 fe 6f . o
jr z,l65eah ;65c6 28 22 ( "
ld bc,00010h ;65c8 01 10 00 . . .
cp 078h ;65cb fe 78 . x
jr z,l65eah ;65cd 28 1b ( .
cp 073h ;65cf fe 73 . s
jr z,l65edh ;65d1 28 1a ( .
cp 063h ;65d3 fe 63 . c
jr z,l65e2h ;65d5 28 0b ( .
pop de ;65d7 d1 .
pop de ;65d8 d1 .
pop de ;65d9 d1 .
l65dah:
jp l6554h ;65da c3 54 65 . T e
l65ddh:
call sub_6502h ;65dd cd 02 65 . . e
jr l65edh ;65e0 18 0b . .
l65e2h:
dec de ;65e2 1b .
ex de,hl ;65e3 eb .
ld (hl),e ;65e4 73 s
ld de,00001h ;65e5 11 01 00 . . .
jr l65f8h ;65e8 18 0e . .
l65eah:
call sub_64e9h ;65ea cd e9 64 . . d
l65edh:
push hl ;65ed e5 .
xor a ;65ee af .
ld de,0ffffh ;65ef 11 ff ff . . .
l65f2h:
inc de ;65f2 13 .
cp (hl) ;65f3 be .
inc hl ;65f4 23 #
jr nz,l65f2h ;65f5 20 fb .
pop hl ;65f7 e1 .
l65f8h:
pop af ;65f8 f1 .
push hl ;65f9 e5 .
cp 073h ;65fa fe 73 . s
jr nz,l6611h ;65fc 20 13 .
ld a,(l6cc2h) ;65fe 3a c2 6c : . l
or a ;6601 b7 .
jr z,l6611h ;6602 28 0d ( .
push de ;6604 d5 .
ld hl,(l6cbfh+1) ;6605 2a c0 6c * . l
push hl ;6608 e5 .
call sub_6391h ;6609 cd 91 63 . . c
pop hl ;660c e1 .
pop de ;660d d1 .
jr nc,l6611h ;660e 30 01 0 .
ex de,hl ;6610 eb .
l6611h:
ld hl,(l6cc2h+1) ;6611 2a c3 6c * . l
dec hl ;6614 2b +
or a ;6615 b7 .
sbc hl,de ;6616 ed 52 . R
inc hl ;6618 23 #
jp p,l661fh ;6619 f2 1f 66 . . f
ld hl,00000h ;661c 21 00 00 ! . .
l661fh:
ld b,h ;661f 44 D
ld c,l ;6620 4d M
xor a ;6621 af .
ld hl,(06cbeh) ;6622 2a be 6c * . l
or l ;6625 b5 .
call nz,sub_6645h ;6626 c4 45 66 . E f
pop hl ;6629 e1 .
l662ah:
ld a,e ;662a 7b {
or d ;662b b2 .
jr z,l6636h ;662c 28 08 ( .
dec de ;662e 1b .
ld a,(hl) ;662f 7e ~
inc hl ;6630 23 #
call l6cceh ;6631 cd ce 6c . . l
jr l662ah ;6634 18 f4 . .
l6636h:
ld hl,(06cbeh) ;6636 2a be 6c * . l
or l ;6639 b5 .
call z,sub_6645h ;663a cc 45 66 . E f
pop de ;663d d1 .
pop hl ;663e e1 .
pop hl ;663f e1 .
dec hl ;6640 2b +
dec hl ;6641 2b +
push hl ;6642 e5 .
jr l65dah ;6643 18 95 . .
sub_6645h:
ld a,b ;6645 78 x
or c ;6646 b1 .
ret z ;6647 c8 .
ld a,h ;6648 7c |
call l6cceh ;6649 cd ce 6c . . l
dec bc ;664c 0b .
jr sub_6645h ;664d 18 f6 . .
sub_664fh:
ld (l6ccfh),hl ;664f 22 cf 6c " . l
pop de ;6652 d1 .
pop af ;6653 f1 .
pop hl ;6654 e1 .
push hl ;6655 e5 .
push af ;6656 f5 .
add hl,sp ;6657 39 9
push de ;6658 d5 .
ld e,(hl) ;6659 5e ^
inc hl ;665a 23 #
ld d,(hl) ;665b 56 V
ld (l6cd1h),de ;665c ed 53 d1 6c . S . l
dec hl ;6660 2b +
dec hl ;6661 2b +
dec hl ;6662 2b +
ret ;6663 c9 .
sub_6664h:
ld a,(de) ;6664 1a .
cp 061h ;6665 fe 61 . a
jr nc,l666bh ;6667 30 02 0 .
add a,020h ;6669 c6 20 .
l666bh:
cp 06ch ;666b fe 6c . l
jr nz,l6670h ;666d 20 01 .
inc de ;666f 13 .
l6670h:
pop bc ;6670 c1 .
pop af ;6671 f1 .
pop hl ;6672 e1 .
push hl ;6673 e5 .
push af ;6674 f5 .
ld a,(de) ;6675 1a .
cp 061h ;6676 fe 61 . a
jr nc,l667ch ;6678 30 02 0 .
add a,020h ;667a c6 20 .
l667ch:
inc de ;667c 13 .
push de ;667d d5 .
push bc ;667e c5 .
ld d,(hl) ;667f 56 V
dec hl ;6680 2b +
ld e,(hl) ;6681 5e ^
ld bc,0000ah ;6682 01 0a 00 . . .
ret ;6685 c9 .
l6686h:
push hl ;6686 e5 .
ld hl,(l6cd1h) ;6687 2a d1 6c * . l
ld a,(hl) ;668a 7e ~
inc hl ;668b 23 #
ld (l6cd1h),hl ;668c 22 d1 6c " . l
pop hl ;668f e1 .
ret ;6690 c9 .
l6691h:
push hl ;6691 e5 .
push de ;6692 d5 .
push bc ;6693 c5 .
ld hl,(l6cd1h) ;6694 2a d1 6c * . l
push hl ;6697 e5 .
call sub_6279h ;6698 cd 79 62 . y b
ld a,l ;669b 7d }
pop bc ;669c c1 .
pop de ;669d d1 .
pop hl ;669e e1 .
ret ;669f c9 .
l66a0h:
push hl ;66a0 e5 .
ld hl,(l6cd1h) ;66a1 2a d1 6c * . l
dec hl ;66a4 2b +
ld (hl),a ;66a5 77 w
ld (l6cd1h),hl ;66a6 22 d1 6c " . l
pop hl ;66a9 e1 .
ret ;66aa c9 .
l66abh:
push hl ;66ab e5 .
push de ;66ac d5 .
push bc ;66ad c5 .
ld l,a ;66ae 6f o
ld h,000h ;66af 26 00 & .
push hl ;66b1 e5 .
ld hl,(l6cd1h) ;66b2 2a d1 6c * . l
push hl ;66b5 e5 .
call sub_629ah ;66b6 cd 9a 62 . . b
pop bc ;66b9 c1 .
pop de ;66ba d1 .
pop hl ;66bb e1 .
ret ;66bc c9 .
ld hl,l6686h ;66bd 21 86 66 ! . f
ld de,l66a0h ;66c0 11 a0 66 . . f
jr l66cbh ;66c3 18 06 . .
ld hl,l6691h ;66c5 21 91 66 ! . f
ld de,l66abh ;66c8 11 ab 66 . . f
l66cbh:
ld (l6ccbh+1),de ;66cb ed 53 cc 6c . S . l
call sub_664fh ;66cf cd 4f 66 . O f
jr l66ebh ;66d2 18 17 . .
ld hl,l6691h ;66d4 21 91 66 ! . f
ld (l6ccfh),hl ;66d7 22 cf 6c " . l
ld hl,l66abh ;66da 21 ab 66 ! . f
l66ddh:
ld (l6ccbh+1),hl ;66dd 22 cc 6c " . l
ld hl,00000h ;66e0 21 00 00 ! . .
ld (l6cd1h),hl ;66e3 22 d1 6c " . l
pop de ;66e6 d1 .
pop hl ;66e7 e1 .
push hl ;66e8 e5 .
push de ;66e9 d5 .
add hl,sp ;66ea 39 9
l66ebh:
push bc ;66eb c5 .
ld e,(hl) ;66ec 5e ^
inc hl ;66ed 23 #
ld d,(hl) ;66ee 56 V
dec hl ;66ef 2b +
dec hl ;66f0 2b +
push hl ;66f1 e5 .
ld a,0c3h ;66f2 3e c3 > .
ld (l6cceh),a ;66f4 32 ce 6c 2 . l
ld (l6ccbh),a ;66f7 32 cb 6c 2 . l
ld hl,00000h ;66fa 21 00 00 ! . .
ld (06cbeh),hl ;66fd 22 be 6c " . l
l6700h:
ld a,(de) ;6700 1a .
inc de ;6701 13 .
or a ;6702 b7 .
jr z,l6725h ;6703 28 20 (
call sub_63d7h ;6705 cd d7 63 . . c
jr nz,l6717h ;6708 20 0d .
l670ah:
call l6cceh ;670a cd ce 6c . . l
call sub_63d7h ;670d cd d7 63 . . c
jr z,l670ah ;6710 28 f8 ( .
call l6ccbh ;6712 cd cb 6c . . l
jr l6700h ;6715 18 e9 . .
l6717h:
cp 025h ;6717 fe 25 . %
jr z,l6733h ;6719 28 18 ( .
ld l,a ;671b 6f o
call l6cceh ;671c cd ce 6c . . l
cp l ;671f bd .
jr z,l6700h ;6720 28 de ( .
call l6ccbh ;6722 cd cb 6c . . l
l6725h:
ld de,(06cbeh) ;6725 ed 5b be 6c . [ . l
l6729h:
pop hl ;6729 e1 .
pop bc ;672a c1 .
pop hl ;672b e1 .
ex (sp),hl ;672c e3 .
add hl,sp ;672d 39 9
pop af ;672e f1 .
ld sp,hl ;672f f9 .
push af ;6730 f5 .
ex de,hl ;6731 eb .
ret ;6732 c9 .
l6733h:
push de ;6733 d5 .
ld hl,0ffffh ;6734 21 ff ff ! . .
ld a,(de) ;6737 1a .
sub 02ah ;6738 d6 2a . *
ld (l6cbfh+1),a ;673a 32 c0 6c 2 . l
jr nz,l6740h ;673d 20 01 .
inc de ;673f 13 .
l6740h:
ld a,(de) ;6740 1a .
call sub_62ach ;6741 cd ac 62 . . b
jr nc,l6749h ;6744 30 03 0 .
call sub_64d0h ;6746 cd d0 64 . . d
l6749h:
ld (l6cbfh+2),hl ;6749 22 c1 6c " . l
call sub_6664h ;674c cd 64 66 . d f
cp 068h ;674f fe 68 . h
jr z,l6783h ;6751 28 30 ( 0
cp 064h ;6753 fe 64 . d
jr z,l6783h ;6755 28 2c ( ,
dec bc ;6757 0b .
dec bc ;6758 0b .
cp 06fh ;6759 fe 6f . o
jr z,l6783h ;675b 28 26 ( &
cp 078h ;675d fe 78 . x
jr z,l676dh ;675f 28 0c ( .
cp 063h ;6761 fe 63 . c
jr z,l67dah ;6763 28 75 ( u
cp 073h ;6765 fe 73 . s
jr z,l67e8h ;6767 28 7f (
pop de ;6769 d1 .
pop de ;676a d1 .
l676bh:
jr l6725h ;676b 18 b8 . .
l676dh:
call l6cceh ;676d cd ce 6c . . l
cp 030h ;6770 fe 30 . 0
jr nz,l677dh ;6772 20 09 .
call l6cceh ;6774 cd ce 6c . . l
cp 078h ;6777 fe 78 . x
jr z,l6780h ;6779 28 05 ( .
cp 058h ;677b fe 58 . X
l677dh:
call nz,l6ccbh ;677d c4 cb 6c . . l
l6780h:
ld bc,00010h ;6780 01 10 00 . . .
l6783h:
push af ;6783 f5 .
push de ;6784 d5 .
ld d,b ;6785 50 P
ld e,c ;6786 59 Y
ld bc,(l6cbfh+2) ;6787 ed 4b c1 6c . K . l
ld hl,00000h ;678b 21 00 00 ! . .
l678eh:
ld a,b ;678e 78 x
or c ;678f b1 .
jr z,l67c1h ;6790 28 2f ( /
dec bc ;6792 0b .
call l6cceh ;6793 cd ce 6c . . l
call sub_62ach ;6796 cd ac 62 . . b