是否可以将堆栈上的元素克隆到X86_64 Linux组装中的堆栈上?
基本上您可以“删除”元素 通过添加到rsp
注册来从堆栈中 n * 8
,但是如果您尝试对面(rsp-(n * 8)
) 它不起作用,这似乎很明显,但是
如果我使用按下
这样的堆栈,
push 10
push 20
那么堆栈基本上是(20; 10)
,如何怎么办我做到了 (20; 10; 20; 10)
无需使用寄存器(因为您有限) 或需要重复push
,
但是如果不可能,最好将其用作替代方案, 重复push
或使用pop
使用寄存器,然后按 他们回来了?
Basically you can 'remove' elements
from the stack by adding to rsp
registern * 8
, but if you try the opposite (rsp - (n * 8)
)
it doesn't work, which seems obvious but still
So if I push to the stack using push
like this:
push 10
push 20
So the stack is basically (20; 10)
, how could I make it(20; 10; 20; 10)
without needing to use registers (Because you're limited)
or needing to repeat the push
But if it's not possible which is better to use as an alternative,
repeating the push
or using registers using pop
and then pushing
them back?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设
n
和push
ed值是恒定的:您的
推动IMM8
正在推动签名扩展的四字。除非您确实在堆栈上需要四字,否则如何将8  nbsp; nbsp; byte值放在堆栈上:
NB:
在远程模式下,不可能仅
按IMM32
,因此rsp  nbsp; rsp  -   4
,因此mov
。推动IMM8
s,但是,我只选择汇编器的扩展功能:Assuming
n
and thepush
ed values are constant:Your
push imm8
is pushing sign-extended quadwords.Unless you really need quadwords on the stack, how about putting 8 individual Byte values on the stack:
NB:
In long mode it is not possible to just
push imm32
so thatrsp ≔ rsp − 4
, hence themov
.push imm8
s, however, I would simply opt for the assembler’s expansion capability: