簡體   English   中英

在這個匯編代碼中,“xorl”和“imul”是做什么用的? 可以轉換成c碼嗎?

[英]What is 'xorl' and 'imul' are used for in this assembly code? Can it be converted to c Code?

int func2(int x, int y)
    
movl 4(%esp), %eax          
addl 8(%esp), %eax            
xorl $255,%eax            
imul 8(%esp), %eax            
sall $4, eax

    

與此 function 對應的 C 代碼類似於

int func2(int x, int y)
{
    int eax;

    eax = x;
    eax += y;
    eax ^= 0xff;
    eax *= y;
    eax <<= 4;

    return (eax);
}

那應該做什么......我不知道。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM