究竟是什么程序堆栈的生长方向? [英] what exactly is program stack's growth direction?

查看:307
本文介绍了究竟是什么程序堆栈的生长方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读的专业汇编语言的理查德·布鲁姆,和我混淆有关在书中矛盾与我想知道到底是什么程序堆栈的生长方向?
这是312页,这是暗示程序堆栈画面长大。

I'm reading Professional Assembly Language by Richard Blum,and I am confusing about a Inconsistency in the book and I wondering what exactly is program stack's growth direction? This is the picture from page 312, which is suggesting that program stack grows up.

但是,当我达到了322页,我看到了另一个版本,这表明程序堆栈向下增长。

But when I reached page 322,I see another version, which suggesting that program stack grows down.

推荐答案

这本书是不是不一致;每个图显示顶部更高的位置。

The book is not inconsistent; each drawing shows higher addresses at the top.

第一图纸说明了一个堆栈向下增长。呼叫者参数推入堆栈,然后调用新的功能。调用的行为将返回地址压入堆栈。被叫方再压入底座指针的当前值压入堆栈,拷贝堆栈指针到基本指针,并且递减堆栈指针,以腾出空间给被叫方的局部变量。

The first drawing illustrates a stack that grows downward. The caller pushes parameters onto the stack, then calls the new function. The act of calling pushes the return address onto the stack. The callee then pushes the current value of the base pointer onto the stack, copies the stack pointer into the base pointer, and decrements the stack pointer to make room for the callee's local variables.

这篇关于究竟是什么程序堆栈的生长方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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