-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path508A.asm
1977 lines (1909 loc) · 32.6 KB
/
508A.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
*Title Disassembling CGEN.COM Hi-Tech C v3.09
*Heading Checking recreated code with original
; File - 508A.asm Created 09.03.2019 Last Modified 31.01.2021
;=========================================================
; sub_508A OK++
;=========================================================
global _sub_508A ; global _sub_508A
global ncsv,cret,indir ; global ncsv, cret, indir
global _sub_14F3 ; global _sub_14F3
global _sub_36E0 ; global _sub_36E0
global _sprintf ; global _sprintf
global _allocmem ; global _allocmem
global _strlen ; global _strlen
global _strcpy ; global _strcpy
global _sub_174C ; global _sub_174C
global _dopetab ; global _dopetab
global _nodesize ; global _nodesize
global wrelop ; global wrelop
global _sub_6246 ; global _sub_6246
global _sub_475C ; global _sub_475C
global wrelop ; global wrelop
global wrelop ; global wrelop
global wrelop ; global wrelop
global _sub_43EF ; global _sub_43EF
psect text
; Disassembled version ; After compiling C source code
_sub_508A:
call ncsv ; call ncsv
defw 0FFE9h ; defw -23
ld l,(ix+6) ; ld l,(ix+6)
ld h,(ix+7) ; ld h,(ix+7)
push hl ; push hl
pop iy ; pop iy
push hl ; push hl
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
cp 3 ; cp 3
jp nz,loc_513A ; jp nz,l12
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
ld a,(hl) ; ld a,(hl)
cp 43h ; cp 67
jp nz,loc_513A ; jp nz,l12
ex de,hl ; ex de,hl
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld e,(hl) ; ld e,(hl)
inc hl ; inc hl
ld d,(hl) ; ld d,(hl)
inc hl ; inc hl
ld a,(hl) ; ld a,(hl)
inc hl ; inc hl
ld h,(hl) ; ld h,(hl)
ld l,a ; ld l,a
ld (ix+-23),e ; ld (ix+-23),e
ld (ix+-22),d ; ld (ix+-22),d
ld (ix+-21),l ; ld (ix+-21),l
ld (ix+-20),h ; ld (ix+-20),h
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
push hl ; push hl
call _sub_36E0 ; call _sub_36E0
ld l,(iy+1Bh) ; ld l,(iy+27)
ld h,(iy+1Ch) ; ld h,(iy+28)
ex (sp),hl ; ex (sp),hl
call _sub_36E0 ; call _sub_36E0
ld e,(ix+-23) ; ld e,(ix+-23)
ld d,(ix+-22) ; ld d,(ix+-22)
ld l,(ix+-21) ; ld l,(ix+-21)
ld h,(ix+-20) ; ld h,(ix+-20)
ex (sp),hl ; ex (sp),hl
push de ; push de
ld hl,d_508A_AA7C ; ld hl,19f
push hl ; push hl
push ix ; push ix
pop de ; pop de
ld hl,0FFEDh ; ld hl,-19
add hl,de ; add hl,de
push hl ; push hl
call _sprintf ; call _sprintf
pop bc ; pop bc
pop bc ; pop bc
pop bc ; pop bc
push ix ; push ix
pop de ; pop de
ld hl,0FFEDh ; ld hl,-19
add hl,de ; add hl,de
ex (sp),hl ; ex (sp),hl
call _strlen ; call _strlen
pop bc ; pop bc
inc hl ; inc hl
push hl ; push hl
call _allocmem ; call _allocmem
ld (iy+19h),l ; ld (iy+25),l
ld (iy+1Ah),h ; ld (iy+26),h
push ix ; push ix
pop de ; pop de
ld hl,0FFEDh ; ld hl,-19
add hl,de ; add hl,de
ex (sp),hl ; ex (sp),hl
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
push hl ; push hl
call _strcpy ; call _strcpy
pop bc ; pop bc
pop bc ; pop bc
call _sub_174C ; call _sub_174C
ld (iy+1Bh),l ; ld (iy+27),l
ld (iy+1Ch),h ; ld (iy+28),h
ld (iy+0),44h ; ld (iy+0),68
loc_5134: ;L9:
push iy ; push iy
pop hl ; pop hl
jp cret ; jp cret
loc_513A: ;l12:
ld de,_dopetab ; ld de,_dopetab
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
ld (ix+-2),l ; ld (ix+-2),l
ld (ix+-1),h ; ld (ix+-1),h
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
add hl,hl ; add hl,hl
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
bit 4,b ; bit 4,b
jp z,loc_51C8 ; jp z,l14
push iy ; push iy
call _nodesize ; call _nodesize
ex (sp),hl ; ex (sp),hl
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
call _nodesize ; call _nodesize
pop bc ; pop bc
pop de ; pop de
call wrelop ; call wrelop
jr c,loc_51C8 ; jp c,l14
push iy ; push iy
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
cp 3 ; cp 3
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
jr z,loc_51CF ; jp z,L3
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
cp 3 ; cp 3
jr z,loc_51C8 ; jp z,l14
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld e,(iy+15h) ; ld e,(iy+21)
ld d,(iy+16h) ; ld d,(iy+22)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld l,(iy+1Bh) ; ld l,(iy+27)
ld h,(iy+1Ch) ; ld h,(iy+28)
push hl ; push hl
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
loc_51B9: ;L4:
push iy ; push iy
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
jp cret ; jp cret
loc_51C8: ;l14:
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
loc_51CF: ;L3:
push iy ; push iy
call _sub_6246 ; call _sub_6246
pop bc ; pop bc
pop bc ; pop bc
ld a,l ; ld a,l
or a ; or a
jr z,loc_520D ; jp z,l18
ld l,(iy+1Bh) ; ld l,(iy+27)
ld h,(iy+1Ch) ; ld h,(iy+28)
push hl ; push hl
call _sub_475C ; call _sub_475C
pop bc ; pop bc
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld e,(iy+15h) ; ld e,(iy+21)
ld d,(iy+16h) ; ld d,(iy+22)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
jr loc_51B9 ; jp L4
loc_520D: ;l18:
push iy ; push iy
call _nodesize ; call _nodesize
ex (sp),hl ; ex (sp),hl
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
call _nodesize ; call _nodesize
pop bc ; pop bc
pop de ; pop de
call wrelop ; call wrelop
jp c,loc_5134 ; jp c,L9
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld a,(hl) ; ld a,(hl)
cp 14h ; cp 20
jp nz,loc_52CD ; jp nz,l20
push iy ; push iy
call _nodesize ; call _nodesize
pop bc ; pop bc
push hl ; push hl
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,25 ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
call _nodesize ; call _nodesize
pop bc ; pop bc
pop de ; pop de
call wrelop ; call wrelop
jp c,loc_52CD ; jp c,l20
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
push iy ; push iy
call _sub_6246 ; call _sub_6246
pop bc ; pop bc
pop bc ; pop bc
ld a,l ; ld a,l
or a ; or h
jr nz,loc_52A1 ; jp nz,l23
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld e,l ; ld e,l
push de ; push de
push iy ; push iy
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
pop de ; pop de
cp e ; cp e
jr nz,loc_52CD ; jp nz,l20
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld e,l ; ld e,l
push de ; push de
push iy ; push iy
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
pop de ; pop de
cp e ; cp e
jr nz,loc_52CD ; jp nz,l20
loc_52A1: ;l23:
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b, (hl) ; ld b,(hl)
ld (iy+19h),c ; ld (iy+25),c
ld (iy+1Ah),b ; ld (iy+26),b
ld hl,1Bh ; ld hl,27
add hl, de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
call _sub_36E0 ; call _sub_36E0
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ex (sp),hl ; ex (sp),hl
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
jp loc_5134 ; jp L9
loc_52CD: ;l20:
ld de,_dopetab ; ld de,_dopetab
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
add hl,hl ; add hl,hl
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
xor a ; xor a
ld l,a ; ld l,a
ld a,b ; ld a,b
and 0Ch ; and 12
ld h,a ; ld h,a
ld a,l ; ld a,l
or h ; or h
jp z,loc_5134 ; jp z,L9
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
push hl ; push hl
call _sub_14F3 ; call _sub_14F3
pop bc ; pop bc
ld a,l ; ld a,l
cp 3 ; cp 3
jp z,loc_5134 ; jp z,L9
ld de,_dopetab ; ld de,_dopetab
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
add hl,hl ; add hl,hl
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
bit 2,b ; bit 2,b
jr z,loc_534B ; jp z,l28
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld a,(hl) ; ld a,(hl)
inc hl ; inc hl
ld h,(hl) ; ld h,(hl)
ld l,a ; ld l,a
ld a,(hl) ; ld a,(hl)
cp 14h ; cp 20
jp nz,loc_5134 ; jp nz,L9
ld l,e ; ld l,e
ld h,d ; ld h,d
push hl ; push hl
call _nodesize ; call _nodesize
pop bc ; pop bc
push hl ; push hl
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld hl,19h ; ld hl,25
add hl,bc ; add hl,bc
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
call _nodesize ; call _nodesize
pop bc ; pop bc
pop de ; pop de
call wrelop ; call wrelop
jp nc,loc_5134 ; jp nc,L9
loc_534B: ;l28:
ld l,(iy+1Bh) ; ld l,(iy+27)
ld h,(iy+1Ch) ; ld h,(iy+28)
push hl ; push hl
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
ld hl,14h ; ld hl,20
push hl ; push hl
call _sub_43EF ; call _sub_43EF
pop bc ; pop bc
pop bc ; pop bc
pop bc ; pop bc
ld (ix+-4),l ; ld (ix+-4),l
ld (ix+-3),h ; ld (ix+-3),h
ld l,(iy+1Bh) ; ld l,(iy+27)
ld h,(iy+1Ch) ; ld h,(iy+28)
push iy ; push iy
pop de ; pop de
push hl ; push hl
ld bc,1Dh ; ld bc,29
ldir ; ldir
pop hl ; pop hl
ld de,_dopetab ; ld de,_dopetab
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
add hl,hl ; add hl,hl
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
bit 3,c ; bit 3,c
push iy ; push iy
jr z,loc_53B4 ; jp z,L1
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,1Bh ; ld hl,27
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
push bc ; push bc
ld hl,14h ; ld hl,20
push hl ; push hl
call _sub_43EF ; call _sub_43EF
pop bc ; pop bc
pop bc ; pop bc
pop bc ; pop bc
push hl ; push hl
pop iy ; pop iy
jr loc_53BC ; jp l32
loc_53B4: ;L1:
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
ld iy,0 ; ld iy,0
loc_53BC: ;l32:
push iy ; push iy
ld l,(ix+-4) ; ld l,(ix+-4)
ld h,(ix+-3) ; ld h,(ix+-3)
push hl ; push hl
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
push hl ; push hl
call _sub_43EF ; call _sub_43EF
pop bc ; pop bc
pop bc ; pop bc
ld (ix+-4),l ; ld (ix+-4),l
ld (ix+-3),h ; ld (ix+-3),h
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ex (sp),hl ; ex (sp),hl
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
ld l,(ix+-4) ; ld l,(ix+-4)
ld h,(ix+-3) ; ld h,(ix+-3)
jp cret ; jp cret
; End of function sub_508A OK++
;=========================================================
; sub_53EE OK++
;=========================================================
global _sub_53EE ; global _sub_53EE
global _byte_B013 ; global _byte_B013
global csv ; global csv
; Disassembled version ; After compiling C source code
_sub_53EE:
call csv ; call csv
push hl ; push hl
ld l,(ix+6) ; ld l,(ix+6)
ld h,(ix+7) ; ld h,(ix+7)
push hl ; push hl
pop iy ; pop iy
ld e,(iy+19h) ; ld e,(iy+25)
ld d,(iy+1Ah) ; ld d,(iy+26)
ld (ix+-2),e ; ld (ix+-2),e
ld (ix+-1),d ; ld (ix+-1),d
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld a,(hl) ; ld a,(hl)
inc hl ; inc hl
ld h,(hl) ; ld h,(hl)
ld l,a ; ld l,a
ld l,(hl) ; ld l,(hl)
ld h,0 ; ld h,0
add hl,hl ; add hl,hl
ld de,_dopetab ; ld de,_dopetab
add hl, de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
bit 4,b ; bit 4,b
jr z,loc_5469 ; jp z,l34
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (ix+-2),c ; ld (ix+-2),c
ld (ix+-1),b ; ld (ix+-1),b
ld e,c ; ld e,c
ld d,b ; ld d,b
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld e,c ; ld e,c
ld d,b ; ld d,b
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld e,(iy+15h) ; ld e,(iy+21)
ld d,(iy+16h) ; ld d,(iy+22)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
push hl ; push hl
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
push iy ; push iy
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
jp cret ; jp cret
loc_5469: ;l34:
ld (iy+0),14h ; ld (iy+0),20
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld (iy+1Bh),l ; ld (iy+27),l
ld (iy+1Ch),h ; ld (iy+28),h
ex de,hl ; ex de,hl
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+19h),c ; ld (iy+25),c
ld (iy+1Ah),b ; ld (iy+26),b
ld l,e ; ld l,e
ld h,d ; ld h,d
ld (hl),41h ; ld (hl),65
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld e,(ix+-2) ; ld e,(ix+-2)
ld d,(ix+-1) ; ld d,(ix+-1)
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld e,(iy+15h) ; ld e,(iy+21)
ld d,(iy+16h) ; ld d,(iy+22)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld a,1 ; ld a,1
ld (_byte_B013),a ; ld (_byte_B013),a
push iy ; push iy
pop hl ; pop hl
jp cret ; jp cret
psect data
d_5cf5_AA6B:
; "%s: large offset"
defb 37,115,58,32,108,97,114,103,101,32,111,102,102,115,101,116
defb 0
d_508A_AA7C:
; "%ld:
defb 37,108,100,0
d_54b6_AA80:
; "mismatched comparision"
defb 109,105,115,109,97,116,99,104,101,100,32,99,111,109,112,97
defb 114,105,115,105,111,110,0
d_54b6_AA97:
; "degenerate unsigned comparision"
defb 100,101,103,101,110,101,114,97,116,101,32,117,110,115,105,103
defb 110,101,100,32,99,111,109,112,97,114,105,115,105,111,110,0
d_54b6_AAB7:
; "'Division by zero'"
defb 68,105,118,105,115,105,111,110,32,98,121,32,122,101,114,111
defb 0
psect text
; End of function sub_53EE OK++
; End of file s508A.as
*Title Disassembling CGEN.COM Hi-Tech C v3.09
*Heading Checking recreated code with original
;=========================================================
; sub_sub_54B6 OK
;=========================================================
global _sub_54B6
global ncsv,cret,indir
global _dopetab
global _sub_4C12
global wrelop
global _byte_B013
global _sub_4B89
global _nodesize
global _sub_60A8
global _sub_14F3
global _sub_62BE
global _sub_36E0
global _word_B015
global _sub_6246
global _sub_4DA3
global _sub_4E8D
global _sub_4C8B
global _sub_4BE5
global _sub_475C
global _sub_415E
global asaladd
global arelop
global _sub_4FA8
global _sub_3712
global _word_AE53
global _word_AED9
global _sub_43EF
global arelop
global _sub_46F7
global _sub_4FCE
global _warning
global allsh
global lland
global lrelop
global _sub_508A
global _sub_53EE
psect text
_sub_54B6:
call ncsv
defw 0FFF6h
ld l,(ix+6)
ld h,(ix+7)
push hl
pop iy
ld de,_dopetab
ld l,(iy+0)
ld h,0
add hl,hl
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld a,c
and 0Ch
ld l,a
xor a
ld h,a
ld (ix+-6),l
ld (ix+-5),h
ld a,l
or (ix+-5)
jr z,loc_54F4
ld l,(iy+19h)
ld h,(iy+1Ah)
push hl
call _sub_54B6
pop bc
ld (iy+19h),l
ld (iy+1Ah),h
loc_54F4:
ld de,8
ld l,(ix+-6)
ld h,(ix+-5)
or a
sbc hl,de
jr nz,loc_5513
ld l,(iy+1Bh)
ld h,(iy+1Ch)
push hl
call _sub_54B6
pop bc
ld (iy+1Bh),l
ld (iy+1Ch),h
loc_5513:
ld de,_dopetab
ld l,(iy+0)
ld h,0
add hl,hl
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
bit 6,c
jp z,loc_5638
ld l,(iy+1Bh)
ld h,(iy+1Ch)
push hl
call _sub_4C12
ex (sp),hl
ld l,(iy+19h)
ld h,(iy+1Ah)
push hl
call _sub_4C12
pop bc
pop de
call wrelop
jp p,loc_556B
ld a,1
ld (_byte_B013),a
ld l,(iy+19h)
ld h,(iy+1Ah)
ld (ix+-2),l
ld (ix+-1),h
ld l,(iy+1Bh)
ld h,(iy+1Ch)
ld (iy+19h),l
ld (iy+1Ah),h
ld l,(ix+-2)
ld h,(ix+-1)
ld (iy+1Bh),l
ld (iy+1Ch),h
loc_556B:
ld de,_dopetab
ld l,(iy+0)
ld h,0
add hl,hl
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
bit 5,b
jp z,loc_5638
ld l,(iy+19h)
ld h,(iy+1Ah)
ld a,(iy+0)
cp (hl)
jp nz,loc_5638
ld l,(iy+1Bh)
ld h,(iy+1Ch)
push hl
call _sub_4B89
pop bc
ld a,l
or a
jr z,loc_55E2
ld e,(iy+19h)
ld d,(iy+1Ah)
ld (ix+-2),e
ld (ix+-1),d
ld hl,1Bh
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
push bc
call _sub_4B89
pop bc
ld a,l
or a
jr z,loc_55E2
ld a,1
ld (_byte_B013),a
ld e,(ix+-2)
ld d,(ix+-1)
ld hl,1Bh
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld (iy+19h),c
ld (iy+1Ah),b
ld hl,1Bh
add hl,de
push iy
pop de
ld (hl),e
inc hl
ld (hl),d
ld l,(ix+-2)
ld h,(ix+-1)
push hl
pop iy
jr loc_5638
loc_55E2:
ld l,(iy+1Bh)
ld h,(iy+1Ch)
push hl
call _sub_4C12
pop bc
push hl
ld e,(iy+19h)
ld d,(iy+1Ah)
ld hl,1Bh
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
push bc
call _sub_4C12
pop bc
pop de
call wrelop
jp p,loc_5638
ld a,1
ld (_byte_B013),a
ld l,(iy+1Bh)
ld h,(iy+1Ch)
ld (ix+-2),l
ld (ix+-1),h
ld e,(iy+19h)
ld d,(iy+1Ah)
ld hl,1Bh
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld (iy+1Bh),c
ld (iy+1Ch),b
ld hl,1Bh
add hl,de
ld e,(ix+-2)
ld d,(ix+-1)
ld (hl),e
inc hl
ld (hl),d
loc_5638:
ld de,_dopetab
ld l,(iy+0)
ld h,0
add hl,hl
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
xor a
ld l,a
ld a,b
and 0Ch
ld h,a
ld de,800h
or a
sbc hl,de
jp nz,loc_5715
ld l,(iy+19h)
ld h,(iy+1Ah)
ld a,(hl)
cp 14h
jp nz,loc_5715
push iy
call _nodesize
pop bc
push hl
ld e,(iy+19h)
ld d,(iy+1Ah)
ld hl,19h
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
push bc
call _nodesize
pop bc
pop de
call wrelop
jp nc,loc_5715
ld e,(iy+19h)
ld d,(iy+1Ah)
ld hl,19h
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
push bc
ld l,(iy+1Bh)
ld h,(iy+1Ch)
push hl
call _sub_60A8
pop bc
pop bc
ld a,l
or a
jp z,loc_5715
ld l,(iy+19h)
ld h,(iy+1Ah)
ld (ix+-4),l
ld (ix+-3),h
ld e,(ix+-4)
ld d,(ix+-3)
ld hl,19h
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld (iy+19h),c
ld (iy+1Ah),b
ld e,c
ld d,b
ld hl,17h
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld (iy+17h),c
ld (iy+18h),b
ld hl,15h
add hl,de
ld c,(hl)
inc hl
ld b,(hl)
ld (iy+15h),c
ld (iy+16h),b
ld e,(iy+1Bh)
ld d,(iy+1Ch)
ld hl,17h
add hl,de
ld e,(iy+17h)
ld d,(iy+18h)
ld (hl),e