相关疑难解决方法(0)

NOPL在x86系统中做了什么?

在x86机器中NOPL的功能是什么?感觉它没有做任何事情,但为什么总是在汇编代码中?

x86 assembly

29
推荐指数
3
解决办法
2万
查看次数

为什么GCC会生成mov%eax,%eax以及它是什么意思?

GCC 4.4.3生成了以下x86_64程序集.令我困惑的部分是mov %eax,%eax.将寄存器移到自身?为什么?

   23b6c:       31 c9                   xor    %ecx,%ecx        ; the 0 value for shift
   23b6e:       80 7f 60 00             cmpb   $0x0,0x60(%rdi)  ; is it shifted?
   23b72:       74 03                   je     23b77
   23b74:       8b 4f 64                mov    0x64(%rdi),%ecx  ; is shifted so load shift value to ecx
   23b77:       48 8b 57 38             mov    0x38(%rdi),%rdx  ; map base
   23b7b:       48 03 57 58             add    0x58(%rdi),%rdx  ; plus offset to value
   23b7f:       8b 02                   mov    (%rdx),%eax      ; load map_used value to eax …
Run Code Online (Sandbox Code Playgroud)

assembly gcc x86-64

27
推荐指数
1
解决办法
9194
查看次数

编译代码中的冗余指令

可能重复:
LEA EAX有什么意义,[EAX]?

在反汇编练习中,我观察到以下代码:

TEST.CPP:

#include <stdio.h>

int main(int argc, char * argv[]) {
    for (int i = 0; i < 10 ; ++i) {
        printf("%i\n", i);
    }
    int i = 0;
    while ( i < 10) {
        printf("%i\n", i);
        ++i;
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

使用vc ++ 2008进行优化编译:

cl /Ox test.cpp
Run Code Online (Sandbox Code Playgroud)

主要功能的反汇编:

.text:00401000 var_4           = dword ptr -4 ; BTW, IDA fails to see that esi is pushed to save it, not to allocate space to local variable
.text:00401000
.text:00401000 …
Run Code Online (Sandbox Code Playgroud)

compiler-construction x86 assembly visual-c++

7
推荐指数
1
解决办法
917
查看次数

标签 统计

assembly ×3

x86 ×2

compiler-construction ×1

gcc ×1

visual-c++ ×1

x86-64 ×1