push 360 mov eax, 7 mul [esp] pop edi 

I can not understand why this program gives the result of 728 .

  • Probably because 104 is located at [esp] ? :) Where does esp show you? - Harry
  • And what do you think should be issued? - Kromster
  • [esp] just right at the top of the stack indicates where exactly 360 lies, the low byte of which is 104 - Mike
  • @Mike Well! Well, what does he point to? per byte, per word, what? - Harry

1 answer 1

You did not specify the size of the operand and the AX is multiplied by one byte from memory. Use an explicit indication of the size of the operand.

 push 360 mov eax, 7 mul dword ptr [esp] pop edi