-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path43EF.asm
447 lines (436 loc) · 10.7 KB
/
43EF.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
*Title Disassembling CGEN.COM Hi-Tech C v3.09
*Heading Checking recreated code with original
; File - 43EF.asm Created 09.03.2019 Last Modified 31.01.2021
;=========================================================
; sub_43EF OK+
;
; Generated code is completely identical, except for
; location of code of branches of "switch" operator.
;
; For easy visual comparison Some parts of compiled code are
; moved in accordance with order of disassembled code from
; binary image.
;=========================================================
global _sub_43EF ; global _sub_43EF
global ncsv,cret,indir ; global ncsv, cret, indir
global _sub_3712 ; global _sub_3712
global _word_AE11 ; global _word_AE11
global _word_AF1B ; global _word_AF1B
global _word_AFE9 ; global _word_AFE9
global _dopetab ; global _dopetab
global _nodesize ; global _nodesize
global _warning ; global _warning
global _sub_475C ; global _sub_475C
global wrelop ; global wrelop
global _sub_385B ; global _sub_385B
global _sub_37ED ; global _sub_37ED
global _sub_36E0 ; global _sub_36E0
global _word_AF1D ; global _word_AF1D
global _word_AED9 ; global _word_AED9
psect text
; Disassembled version ; After compiling С source code
_sub_43EF:
call ncsv ; call ncsv
defw 0FFFAh ; defw -6
call _sub_3712 ; call _sub_3712
push hl ; push hl
pop iy ; pop iy
ld a,(ix+6) ; ld a,(ix+6)
ld (iy+0),a ; ld (iy+0),a
ld l,(ix+8) ; ld l,(ix+8)
ld h,(ix+9) ; ld h,(ix+9)
ld (iy+19h),l ; ld (iy+25),l
ld (iy+1Ah),h ; ld (iy+26),h
ld l,(ix+0Ah) ; ld l,(ix+10)
ld h,(ix+0Bh) ; ld h,(ix+11)
ld (iy+1Bh),l ; ld (iy+27),l
ld (iy+1Ch),h ; ld (iy+28),h
ld de,_dopetab ; ld de,_dopetab
ld l,(iy+0) ; ld l,(iy+0)
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)
ld a,c ; ld a,c
and 30h ; and 48
ld l,a ; ld l,a
xor a ; xor a
ld h,a ; ld h,a
or a ; or a
jr nz,loc_443E ; jp nz,l17
ld a,l ; ld a,l
cp 10h ; cp 16
jp z,loc_4493 ; jp z,l14
cp 20h ; cp 32
jp z,loc_449E ; jp z,l15
cp 30h ; cp 48
jp z,loc_44A3 ; jp z,l16
loc_443E: ;l17:
ld e,(ix+8) ; ld e,(ix+8)
ld d,(ix+9) ; ld d,(ix+9)
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+17h),c ; ld (iy+23),c
ld (iy+18h),b ; ld (iy+24),b
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+15h),c ; ld (iy+21),c
ld (iy+16h),b ; ld (iy+22),b
loc_445E: ;l19:
ld a,(iy+0) ; ld a,(iy+0)
cp 3 ; cp 3
jp z,loc_4666 ; jp z,l20
cp 9 ; cp 9
jp z,loc_4605 ; jp z,l24
cp 0Ah ; cp 10
jp z,loc_464B ; jp z,l28
cp 0Dh ; cp 13
jp z,loc_464B ; jp z,l28
cp 14h ; cp 20
jp z,loc_45E2 ; jp z,l35
cp 16h ; cp 22
jr z,loc_44A8 ; jp z,l29
cp 1Bh ; cp 27
jp z,loc_4652 ; jp z,l32
cp 1Ch ; cp 28
jp z,loc_45E2 ; jp z,l35
cp 30h ; cp 48
jp z,loc_45E2 ; jp z,l35
loc_448D: ;l18:
push iy ; push iy
pop hl ; pop hl
jp cret ; jp cret
loc_4493: ;l14:
ld hl,(_word_AE11) ; ld hl,(_word_AE11)
loc_4496: ;L5:
ld (iy+17h),l ; ld (iy+23),l
ld (iy+18h),h ; ld (iy+24),h
jr loc_445E ; jp l19
loc_449E: ;l15:
ld hl,(_word_AF1B) ; ld hl,(_word_AF1B)
jr loc_4496 ; jp L5
loc_44A3: ;l16:
ld hl,(_word_AFE9) ; ld hl,(_word_AFE9)
jr loc_4496 ; jp L5
loc_44A8: ;l29:
ld l,(ix+8) ; ld l,(ix+8)
ld h,(ix+9) ; ld h,(ix+9)
ld a,(hl) ; ld a,(hl)
cp 41h ; cp 65
jp nz,loc_4519 ; jp nz,l30
ex de,hl ; ex de,hl
ld hl,17h ; ld hl,23
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
push iy ; push iy
call _sub_36E0 ; call _sub_36E0
ld l,(ix+8) ; ld l,(ix+8)
ld h,(ix+9) ; ld h,(ix+9)
ex (sp),hl ; ex (sp),hl
call _sub_36E0 ; call _sub_36E0
pop bc ; pop bc
ld l,(ix+0Ah) ; ld l,(ix+10)
ld h,(ix+0Bh) ; ld h,(ix+11)
push hl ; push hl
pop iy ; pop iy
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
ld (iy+17h),l ; ld (iy+23),l
ld (iy+18h),h ; ld (iy+24),h
ex de,hl ; ex de,hl
ld hl,13h ; ld hl,19
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
add hl,hl ; add hl,hl
add hl,bc ; add hl,bc
inc hl ; inc hl
inc hl ; inc hl
ld e,(hl) ; ld e,(hl)
inc hl ; inc hl
ld d,(hl) ; ld d,(hl)
ld a,d ; ld a,d
rla ; rla
sbc a,a ; sbc a,a
ld l,a ; ld l,a
ld h,a ; ld h,a
push hl ; push hl
push de ; push de
ld e,(ix+0Ah) ; ld e,(ix+10)
ld d,(ix+0Bh) ; ld d,(ix+11)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
pop de ; pop de
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
inc hl ; inc hl
pop bc ; pop bc
ld (hl),c ; ld (hl),c
inc hl ; inc hl
ld (hl),b ; ld (hl),b
jp loc_448D ; jp l18
loc_4519: ;l30:
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld hl,13h ; ld hl,19
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld e,(ix+0Ah) ; ld e,(ix+10)
ld d,(ix+0Bh) ; ld d,(ix+11)
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
add hl,hl ; add hl,hl
add hl,bc ; add hl,bc
inc hl ; inc hl
inc hl ; inc hl
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,0Fh ; ld hl,15
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+17h),c ; ld (iy+23),c
ld (iy+18h),b ; ld (iy+24),b
ld hl,0Dh ; ld hl,13
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+15h),c ; ld (iy+21),c
ld (iy+16h),b ; ld (iy+22),b
ld hl,11h ; ld hl,17
add hl,de ; add hl,de
ld e,(hl) ; ld e,(hl)
inc hl ; inc hl
ld d,(hl) ; ld d,(hl)
ld a,d ; ld a,d
rla ; rla
sbc a,a ; sbc a,a
ld l,a ; ld l,a
ld h,a ; ld h,a
push hl ; push hl
push de ; push de
ld e,(ix+0Ah) ; ld e,(ix+10)
ld d,(ix+0Bh) ; ld d,(ix+11)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
pop de ; pop de
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
inc hl ; inc hl
pop bc ; pop bc
ld (hl),c ; ld (hl),c
inc hl ; inc hl
ld (hl),b ; ld (hl),b
ld e,(ix+0Ah) ; ld e,(ix+10)
ld d,(ix+0Bh) ; ld d,(ix+11)
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld de,(_word_AF1D) ; ld de,(_word_AF1D)
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
inc hl ; inc hl
inc hl ; inc hl
inc hl ; inc hl
bit 4,(hl) ; bit 4,(hl)
jp z,loc_448D ; jp z,l18
call _sub_3712 ; call _sub_3712
ld (ix+8),l ; ld (ix+8),l
ld (ix+9),h ; ld (ix+9),h
push iy ; push iy
pop hl ; pop hl
ld e,(ix+8) ; ld e,(ix+8)
ld d,(ix+9) ; ld d,(ix+9)
push hl ; push hl
ld bc,1Dh ; ld bc,29
ldir ; ldir
pop hl ; pop hl
ld e,(ix+8) ; ld e,(ix+8)
ld d,(ix+9) ; ld d,(ix+9)
ld hl,19h ; ld hl,25
add hl,de ; add hl,de
push iy ; push iy
pop de ; pop de
ld (hl),e ; ld (hl),e
inc hl ; inc hl
ld (hl),d ; ld (hl),d
ld l,(ix+8) ; ld l,(ix+8)
ld h,(ix+9) ; ld h,(ix+9)
push hl ; push hl
pop iy ; pop iy
ld (iy+0),47h ; ld (iy+0),71
ld l,(ix+-2) ; ld l,(ix+-2)
ld h,(ix+-1) ; ld h,(ix+-1)
; jp L2
loc_45D9: ;L2:
ld (iy+1Bh),l ; ld (iy+27),l
ld (iy+1Ch),h ; ld (iy+28),h
jp loc_448D ; jp l18
loc_45E2: ;l35:
ld e,(iy+1Bh) ; ld e,(iy+27)
ld d,(iy+1Ch) ; ld d,(iy+28)
ld hl,17h ; ld hl,23
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+17h),c ; ld (iy+23),c
ld (iy+18h),b ; ld (iy+24),b
ld hl,15h ; ld hl,21
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+15h),c ; ld (iy+21),c
ld (iy+16h),b ; ld (iy+22),b
jp loc_448D ; jp l18
loc_4605: ;l24:
ld a,(iy+15h) ; ld a,(iy+21)
or (iy+16h) ; or (iy+22)
jr nz,loc_4642 ; jp nz,l25
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld hl,0Bh ; ld hl,11
add hl,de ; add hl,de
ld e,(hl) ; ld e,(hl)
inc hl ; inc hl
ld d,(hl) ; ld d,(hl)
ld hl,1 ; ld hl,1
call wrelop ; call wrelop
jr nc,loc_4642 ; jp nc,l25
ld e,(iy+17h) ; ld e,(iy+23)
ld d,(iy+18h) ; ld d,(iy+24)
ld hl,0Dh ; ld hl,13
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+15h),c ; ld (iy+21),c
ld (iy+16h),b ; ld (iy+22),b
ld hl,0Fh ; ld hl,15
add hl,de ; add hl,de
ld c,(hl) ; ld c,(hl)
inc hl ; inc hl
ld b,(hl) ; ld b,(hl)
ld (iy+17h),c ; ld (iy+23),c
ld (iy+18h),b ; ld (iy+24),b
loc_4642: ;l25:
push iy ; push iy
call _sub_385B ; call _sub_385B
loc_4647: ;L4:
pop bc ; pop bc
jp loc_448D ; jp l18
loc_464B: ;l28:
push iy ; push iy
call _sub_37ED ; call _sub_37ED
jr loc_4647 ; jp L4
loc_4652: ;l32:
ld hl,(_word_AED9) ; ld hl,(_word_AED9)
ld (iy+17h),l ; ld (iy+23),l
ld (iy+18h),h ; ld (iy+24),h
ld (iy+15h),1 ; ld (iy+21),1
ld (iy+16h),0 ; ld (iy+22),0
jp loc_448D ; jp l18
loc_4666: ;l20:
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
ld a,(hl) ; ld a,(hl)
cp 42h ; cp 66
jr nz,loc_4691 ; jp nz,l21
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 hl,9 ; ld hl,9
add hl,bc ;add hl,bc
ld e,(hl) ; ld e,(hl)
inc hl ; inc hl
ld d,(hl) ; ld d,(hl)
ld hl,0 ; ld hl,0
ld (ix+-6),e ; ld (ix+-6),e
ld (ix+-5),d ; ld (ix+-5),d
ld (ix+-4),l ; ld (ix+-4),l
ld (ix+-3),h ; ld (ix+-3),h
jr loc_46AC ; jp l22
loc_4691: ;l21:
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
push hl ; push hl
call _nodesize ; call _nodesize
pop bc ; pop bc
ex de,hl ; ex de,hl
ld hl,0 ; ld hl,0
ld (ix+-6),e ; ld (ix+-6),e
ld (ix+-5),d ; ld (ix+-5),d
ld (ix+-4),l ; ld (ix+-4),l
ld (ix+-3),h ; ld (ix+-3),h
loc_46AC: ;l22:
ld a,(ix+-6) ; ld a,(ix+-6)
or (ix+-5) ; or (ix+-5)
or (ix+-4) ; or (ix+-4)
or (ix+-3) ; or (ix+-3)
jr nz,loc_46C2 ; jp nz,l23
ld hl,19f ; ld hl,19f
push hl ; push hl
call _warning ; call _warning
pop bc ; pop bc
loc_46C2: ;l23:
ld l,(iy+19h) ; ld l,(iy+25)
ld h,(iy+1Ah) ; ld h,(iy+26)
push hl ; push hl
call _sub_475C ; call _sub_475C
pop bc ; pop bc
ld (iy+0),43h ; ld (iy+0),67
ld hl,(_word_AE11) ; ld hl,(_word_AE11)
ld (iy+17h),l ; ld (iy+23),l
ld (iy+18h),h ; ld (iy+24),h
ld (iy+15h),0 ; ld (iy+21),0
ld (iy+16h),0 ; ld (iy+22),0
ld e,(ix+-6) ; ld e,(ix+-6)
ld d,(ix+-5) ; ld d,(ix+-5)
ld l,(ix+-4) ; ld l,(ix+-4)
ld h,(ix+-3) ; ld h,(ix+-3)
ld (iy+19h),e ; ld (iy+25),e
ld (iy+1Ah),d ; ld (iy+26),d
jp loc_45D9 ; (jp L2)
psect data
p_43ef_AA1F:
; 'Sizeof yields 0'
19: defb 83,105,122,101,111,102,32,121,105,101,108,100,115,32,48,0
psect text
; End of function sub_43EF
; Endof file 43EF.as