I think 0.2 is superior than 0.1.
Summarize the reasons.
What I need = convert jump opecodes to equivalent "if" or "while" clause. It helps me to know program's work flow easily. It is very important to shorten codes conversion costs.
What I need not = convert primitive opecodes such as convert from "mov
si,[bp+06]" to "si = pp06". I prefer to
convert these codes in hand work.
After conversion:
void _0cee_241b()
{
//^0CEE:241B C8040000 enter 0004,00
//^0CEE:241F 837E06FF cmp word [bp+06],FFFF if word [bp+06] != FFFF
//^0CEE:2423 7503 jne 00002428 ($+3) then JMP _2428
if (true) //^0CEE:2425 E9CD00 jmp 000024F5 ($+cd) else JMP _24f5
_2428:
//^0CEE:2428 837E0680 cmp word [bp+06],FF80 if word [bp+06] >= FF80
//^0CEE:242C 7310 jnc 0000243E ($+10) then JMP _243e
if (true) {
//^0CEE:242E FF7606 push word [bp+06]
//^0CEE:2431 0E push cs
//^0CEE:2432 E8A6E5 call 000009DB ($-1a5a) call 0CEE:09DB
//^0CEE:2435 59 pop cx
//^0CEE:2436 8946FC mov [bp-04],ax
//^0CEE:2439 8956FE mov [bp-02],dx
//^0CEE:243C EB08 jmp short 00002446 ($+8) JMP _2446
}
_243e:
//^0CEE:243E 8A4606 mov al,[bp+06]
//^0CEE:2441 2C80 sub al,80
//^0CEE:2443 E9B100 jmp 000024F7 ($+b1) JMP _24f7
if (true) {
_2446:
//^0CEE:2446 8B5E06 mov bx,[bp+06]
//^0CEE:2449 81E3003C and bx,3C00
//^0CEE:244D C1EB0A shr bx,0A
//^0CEE:2450 4B dec bx
//^0CEE:2451 4B dec bx
//^0CEE:2452 83FB0D cmp bx,000D if BX <= 000D
//^0CEE:2455 7603 jbe 0000245A ($+3) then JMP _245a
if (true) //^0CEE:2457 E99B00 jmp 000024F5 ($+9b) else JMP _24f5
_245a:
//^0CEE:245A D1E3 shl bx,1
//^0CEE:245C 2EFFA7F924 jmp near word cs:[bx+24F9] JMP _ffffffff
_24f5:
//^0CEE:24F5 B0FF mov al,FF
}
_24f7:
//^0CEE:24F7 C9 leave
//^0CEE:24F8 CB retf
}
Before conversion:
0CEE:241B C8040000 enter 0004,00 0CEE:241F 837E06FF cmp word [bp+06],FFFF 0CEE:2423 7503 jne 00002428 ($+3) 0CEE:2425 E9CD00 jmp 000024F5 ($+cd) 0CEE:2428 837E0680 cmp word [bp+06],FF80 0CEE:242C 7310 jnc 0000243E ($+10) 0CEE:242E FF7606 push word [bp+06] 0CEE:2431 0E push cs 0CEE:2432 E8A6E5 call 000009DB ($-1a5a) 0CEE:2435 59 pop cx 0CEE:2436 8946FC mov [bp-04],ax 0CEE:2439 8956FE mov [bp-02],dx 0CEE:243C EB08 jmp short 00002446 ($+8) 0CEE:243E 8A4606 mov al,[bp+06] 0CEE:2441 2C80 sub al,80 0CEE:2443 E9B100 jmp 000024F7 ($+b1) 0CEE:2446 8B5E06 mov bx,[bp+06] 0CEE:2449 81E3003C and bx,3C00 0CEE:244D C1EB0A shr bx,0A 0CEE:2450 4B dec bx 0CEE:2451 4B dec bx 0CEE:2452 83FB0D cmp bx,000D 0CEE:2455 7603 jbe 0000245A ($+3) 0CEE:2457 E99B00 jmp 000024F5 ($+9b) 0CEE:245A D1E3 shl bx,1 0CEE:245C 2EFFA7F924 jmp near word cs:[bx+24F9] 0CEE:24F5 B0FF mov al,FF 0CEE:24F7 C9 leave 0CEE:24F8 CB retf