-
-
[旧帖]
[求助]请教一段简单的代码,将它的流程用高级语言方式写出来
0.00雪花
-
发表于:
2008-6-5 00:54
3735
-
[旧帖] [求助]请教一段简单的代码,将它的流程用高级语言方式写出来
0.00雪花
这是一段简单的代码,请大家帮忙看一看,能不能实现:
1.把它的流程用高级语言的方式写出来.
2.不使用goto.
3.代码块不重复使用.
如果不能实现,那么能不能从逻辑理论上证明呢?
condX 表示条件转移
codeX 表示代码块
.text:0048D4C2 call CFile_Open ; CFile::Open(const char* file,int flag,CFileException* exception);
.text:0048D4C7 test eax, eax
.text:0048D4C9 jz short loc_48D533 ; ----------------------------cond0
.text:0048D4CB lea eax, [esp+148h+dataBlockCount] ; ----------------------------code0
.text:0048D4CF push 4
.text:0048D4D1 push eax
.text:0048D4D2 lea ecx, [esp+150h+fileObject]
.text:0048D4D6 mov [esp+150h+dataBlockCount], edi
.text:0048D4DA call CFile_Read ; CFile::Read(void* buffer,int readCount)
.text:0048D4DF cmp [esp+148h+dataBlockCount], edi
.text:0048D4E3 jbe short loc_48D528 ; ----------------------------cond1
.text:0048D4E5
.text:0048D4E5 loc_48D4E5:
.text:0048D4E5 lea ecx, [esp+148h+dataBlockbuffer] ; ----------------------------code2
.text:0048D4E9 push 108h
.text:0048D4EE push ecx
.text:0048D4EF lea ecx, [esp+150h+fileObject]
.text:0048D4F3 call CFile_Read ; CFile::Read(void* buffer,int readCount)
.text:0048D4F8 cmp eax, 108h
.text:0048D4FD jb short loc_48D526 ; ----------------------------cond2
.text:0048D4FF mov eax, [esi+0Ch] ; ----------------------------code4
.text:0048D502 lea ecx, [esi+4]
.text:0048D505 lea edx, [esp+148h+dataBlockbuffer]
.text:0048D509 push edx
.text:0048D50A push 1
.text:0048D50C push eax
.text:0048D50D call sub_405C45
.text:0048D512 mov eax, [esp+148h+dataBlockCount]
.text:0048D516 inc edi
.text:0048D517 cmp edi, eax
.text:0048D519 jb short loc_48D4E5 ; ----------------------------cond3
.text:0048D51B lea ecx, [esp+148h+fileObject] ; ----------------------------code6
.text:0048D51F call CFile_Close
.text:0048D524 jmp short loc_48D535 ; ----------------------------code7
.text:0048D526 ; ---------------------------------------------------------------------------
.text:0048D526
.text:0048D526 loc_48D526:
.text:0048D526 mov bl, 1 ; ----------------------------code5
.text:0048D528
.text:0048D528 loc_48D528:
.text:0048D528 lea ecx, [esp+148h+fileObject] ; ----------------------------code3
.text:0048D52C call CFile_Close
.text:0048D531 jmp short loc_48D535 ; ----------------------------code7
.text:0048D533 ; ---------------------------------------------------------------------------
.text:0048D533
.text:0048D533 loc_48D533:
.text:0048D533 mov bl, 1 ; ----------------------------code1
.text:0048D535
.text:0048D535 loc_48D535:
.text:0048D535 ; TableFileInfo_readImpl+101j
.text:0048D535 test bl, bl ; ----------------------------code7
.text:0048D537 setz bl
.text:0048D53A mov [esp+148h+exceptionObject], offset off_51A5CC
.text:0048D542 lea ecx, [esp+148h+var_128]
.text:0048D546 mov byte ptr [esp+148h+var_4], 4
.text:0048D54E call CException_Dtor
.text:0048D553 lea ecx, [esp+148h+fileObject]
.text:0048D557 mov [esp+148h+var_4], 0FFFFFFFFh
.text:0048D562 call CFile_Dtor
.text:0048D567 mov ecx, [esp+148h+var_C]
.text:0048D56E pop edi
.text:0048D56F mov al, bl
.text:0048D571 pop esi
.text:0048D572 pop ebx
.text:0048D573 mov large fs:0, ecx
.text:0048D57A add esp, 13Ch
.text:0048D580 retn
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!