+ -
当前位置:首页 → 问答吧 → 请教一段汇编代码

请教一段汇编代码

时间:2011-09-27

来源:互联网

Assembly code

movzx   edx, cl
mov     eax, 66666667h
imul    edx
sar     edx, 2
mov     eax, edx
shr     eax, 1Fh
add     eax, edx
;cmp     eax, 1




eax 为最终的值,请问这段是否能这样翻译成C++:

C/C++ code

//unsigned char cl=.... 
int ls=char(cl)/10;                                    
if(char(cl)<0)
    ls++;

作者: PDD123   发布时间: 2011-09-27

ls++ 的话应该是 inc eax
这样吧

作者: WJN92   发布时间: 2011-09-29