0

enter image description here

Hi guys, I'm just practising the difference between global and local variables and how they are represented in x86 assembly. I just don't understand the use of the ds segment register and the NOP slide at the end (nop and xchg ax, ax are the same thing).

Thanks for your help!

  • Please provide a textual version of your code instead of a screenshot. Additionally, it would be easier to understand and explain if you included the code you wrote as well. – tmr232 Feb 06 '20 at 15:28

1 Answers1

1

You can refer to this answer for the DS part.

I believe the nop and xchg are only paddings. They appear after ret, and they aren't executed as part of the function.

macro_controller
  • 1,858
  • 10
  • 28