nasm Intel:在不使用 pop 的情况下访问堆栈中的项目 [英] nasm Intel: Access items in the stack without using pop

查看:18
本文介绍了nasm Intel:在不使用 pop 的情况下访问堆栈中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想在不使用 POP 的情况下查看堆栈顶部的两个元素.

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 预递减栈指针,POP 后递增.因此,要查看前两个 DWORD:

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

这篇关于nasm Intel:在不使用 pop 的情况下访问堆栈中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆