我需要在GAS中初始化堆栈吗?
你好!目前我正在学习装配基础知识。早些时候我使用 TASM 和 Intel 语法。在那里我必须以某种方式初始化堆栈。 但现在我使用 GNU 汇编器和 AT&T 语法。我查看了很多示例,没有看到任何堆栈的声明/初始化。我想知道我是否必须这样做?或者,也许,它是在没有我帮助的情况下制作的?如果是这样,它到底是如何自动初始化的?擦除数据段中的重要信息是否存在风险?我也没有注意到任何有关堆栈的指令。
感谢您提前的回答! 哦,还有一件事:有没有关于类 Unix 系统的 ASM (GAS) 编程的好书?
Hallo! Currently I'm learning basics of assembly. Earlier I was using TASM and Intel-syntax. There I had to initialize stack in some ways.
But now I'm using GNU Assembler and AT&T syntax. I looked through lots of examples and saw no any declaration/initialization of stack. I wonder if I have to do it? Or, may be, it's made without my help here? If is so, how exactly is it initialized automatically? Are there risks to rub important info in data-segment? I didn't also notice any directives concerning stack.
Thanks for your answers beforehand!
Oh, one more thing: are there any good books concerning programming in ASM (GAS) for Unix-like systems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
具有虚拟内存的操作系统处理堆栈的方式与不具有虚拟内存的操作系统的处理方式略有不同。
ulimit -s
)。由于每个进程都有自己的虚拟地址空间,因此堆栈和任何其他映射的虚拟内存区域之间存在大量空间。An OS with Virtual Memory handles the stack somewhat differently than how an OS without Virtual Memory handles it.
ulimit -s
on Linux). Since each process has its own virtual address space, there is a lot of space between the stack and any other mapped virtual memory area.