64位应用程序:布局在内存 [英] 64 bit application: layout in memory

查看:367
本文介绍了64位应用程序:布局在内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

64位操作系统指的通用寄存器的位宽度。它能够一次处理64位(数据+操作)。

64 bit OS refers to the bit width of the general purpose registers. It's able to process 64 bits (data + operations) at a time.

我们知道,为了使64位系统是真正有用的,程序员需要写64位应​​用程序。

We know that in order for the 64 bit system to be truly useful, programmers need to write 64 bit applications.

不过,不知所不同的是一个32位应用程序和64位应用程序之间有什么?我不要求我需要编译一个64位的应用程序了哪些配置更改;相反,我想知道这两个应用程序在内存中的结构性差异。

However, I wonder what the difference is between a 32 bit application and a 64 bit application? I'm not asking what configuration changes I need to make to compile a 64 bit application; instead, I'd like to know the structural differences of the two applications in memory.

例如,Linux上的C程序通常是这样的记忆: 1,文本段 2,初始化数据段 3,未初始化的数据段 4,堆 5,协议栈

For example, a C program on Linux would typically look like this in memory: 1, text segment 2, initialized data segment 3, uninitialized data segment 4, heap 5, stack

我想像的64位应用程序看起来相同的布局结构而言在内存中,除了地址为每个字节(假设字节寻址系统)具有更多的比特。如果这是真的,什么是64位意味着什么呢?只是更大的可寻址内存空间?

I'd imagine the 64 bit application would look the same in terms of layout structure in memory, except that the address for each byte (assuming byte addressable system) has more bits. If that's true, what does the 64-bit imply? simply larger addressable memory space?

此外,64位应用程序编译时,让我们假设在源$ C ​​$ C一条指令被编译成外接MIPS指令汇编code:

Also, when a 64-bit application is compiled, let's assume one instruction in the source code is compiled into the add mips instruction in assembly code:


add $1 $2 $1 // $1 += $2;

每个MIPS指令是连接codeD完全相同32位。因此,这里的问题,如果一个应用程序被配置为编译为64位应用程序,会是什么添加指令是什么样子?它仍然有32位还是它扩展到64位,打破了MIPS治呢?如果它仍然是32位的,我没有看到一个64位的应用程序有什么区别,使其带来的64位操作系统的充分发挥。

Each mips instruction is encoded in exactly 32 bits. So here's the question, if an application is configured to be compiled as a 64 bit app, what would the add instruction look like? does it still have 32 bits or is it extended to 64 bit which breaks the mips rule? If it's still 32 bits, I don't see what difference a 64 bit app make so that it "brings 64 bit os into full play".

请赐教。

推荐答案

首先,标记与MIPS的问题,但提出一个一般性的问题。在MIPS 64位应用程序的布局并不像在其他64位体系结构。但布局是怎样的东西被安排在内存中,而不是分段像你说的。这些细分市场都只是记忆区和几乎所有的架构拥有这些代码段的可执行文件

First, you tagged the question with MIPS but the ask a general question. The layout of 64-bit apps in MIPS aren't like in other 64-bit architectures. But layouts are how things are arranged in memory, not the segments like you said. Those segments are just memory "zones" and almost all architectures have those segments in their executables

64位体系结构并非单纯的扩大范围的可寻址内存,而且提供了新的指令集。由于一些旧指令不与64位数据的工作,使他们必须创建新的指令来处理。

64-bit architectures are not simply an "extend range" of addressable memory but also provide a new instruction set. Because some of the old instructions don't work with 64-bit data so they must create new instructions to deal with.

关于说明,MIPS 64位的仍使用32位指令。如果是扩展到64位的话那会是什么,在加入32位包含,而其他32位已经足够(如果不是有些多余)重新present所有参数。但是,当然有64位数字的许多新的指令(如移超过31或加载/存储双字...)。并且顺便说一句,该指令是不正确的,而不

About instructions, MIPS 64-bit still use 32-bit instruction. If it was extend to 64-bit then what would it contain in the added 32 bits while the other 32-bit was already enough (if not somewhat redundant) to represent all the arguments. But of course there were many new instructions for 64-bit numbers (such as shifting more than 31 or load/store double word...). And btw, the instruction is not correct without ,

这篇关于64位应用程序:布局在内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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