1

请解释这行代码:

mov dword[ss:rbp-0x0+var_m4], 0x0

据我了解:

  • 它是一个指针
  • 但它指向哪里?
  • ss::rbp-0x0+var_m4 是什么意思?
  • rbp 是基指针,对吧?
4

1 回答 1

3
- it is a pointer

Sorta. At the assembly level, the notion of a "pointer" is a little less well-defined than at the level of a higher-level language like C or C++. It is, however, doing address arithmetic to compute the address to store data to.

- but where does it point to?

No idea. You'd have to look at earlier instructions, and the value of the var_m4 label, and the current contents of the rbp register to know for sure.

- what does ss::rbp-0x0+var_m4 mean?

It calculates the memory address by adding the current contents of the rbp register, the label or constant value var_m4, and the immediate value 0. The ss: segment prefix indicates whatever it is doing is on the stack, though. So, it's probably either a reference to an an element of an array allocated on your stack, or possibly a structure member or something.

- rbp is the base pointer, right?

Usually, although that register can be spilled and re-used for other things within the body of your function, depending on the optimization level and flags given to your compiler.

于 2013-06-10T19:19:53.867 回答