为什么参数存储在x86-64 Assembly中的寄存器中而不是堆栈中? [英] Why parameters stored in registers and not on the stack in x86-64 Assembly?

查看:119
本文介绍了为什么参数存储在x86-64 Assembly中的寄存器中而不是堆栈中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在x86-32组件中,参数存储在堆栈中,而在x86-64中,参数存储在寄存器中.是什么原因呢?

In x86-32 assembly, parameters are stored on the stack but in x86-64, parameters stored in registers. What is the reason for this?

推荐答案

访问CPU寄存器比访问RAM快很多.

It is (a lot) faster to access CPU registers than to access RAM.

由于64位CPU具有更多的通用寄存器(与64位无关,只是因为它们是更新/更大的),因此使用它们是有意义的.

Since 64bit CPU have a lot more general purpose registers (has nothing to do with being 64bit, it's just because they are newer/bigger), it makes sense to make use of them.

这篇关于为什么参数存储在x86-64 Assembly中的寄存器中而不是堆栈中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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