سؤال

Suppose I want to see the top two elements in the stack without using POP.

How can I access it - I am trying:

mov ebp, esp
mov eax, [ebp]
mov ebx, [ebp-4]
هل كانت مفيدة؟

المحلول

PUSH pre-decrements the stack pointer, and POP post-increments it. So to peek at the top two DWORDS:

mov eax, [esp]    ; Top of stack
mov ebx, [esp+4]  ; Second element on the stack
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top