汇编语言:程序计数器大小
程序计数器的大小由什么决定?
所以,这就是我所知道的:
内存地址寄存器(MAR)的大小是log2(内存空间)。
PC大小与每个内存地址的可寻址性相同还是与MAR相同?
例如,如果给定内存空间为16M,每个内存空间为16位可寻址,则MAR size 将是 24 位可寻址以指定内存地址位置。
PC 大小是 24 位(与 MAR 相同)还是 32 位(每个空间的可寻址性)?
What determines the size of the Program Counter?
So, this is what I know:
Memory Address Register (MAR) size is the log2(memory space).
Is the PC size the same as the addressability of each memory address or the same as the MAR?
For example, if memory space is given to be 16M and each memory space is 16-bit addressable, then MAR size will be 24 bits addressable to specify a memory address location.
Is the PC size 24 bits—the same as the MAR—or 32 bits—the addressability of each space?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道 MAR 是什么,但通常您的程序计数器(又名指令指针)寄存器足够大,可以寻址所有程序内存。通常。
最初的 i80x86 CPU 将指令指针有效地分为两部分:段选择器和偏移量。访问物理内存时进入地址总线的实际地址是使用这两个部分形成的。在所谓的实寻址模式下,地址简单来说就是
段选择器*16+偏移
。这 2 个部分都是 16 位的,这种寻址方案可以让您访问大约 1MB 的内存。如果您只更改指令指针而不更改段,那么您将被限制为 64KB。还有其他具有分割指令指针的处理器。例如,德州仪器 (TI) 的 TMS320C54xx。回到 x86...在 64 位 x86 CPU 上,指令指针是 64 位长。然而,CPU 可能不(而且我认为仍然不)支持完整的 64 位内存地址,仅使用低 52 位左右。这是一个指令指针大于访问所有内存所需的示例。
I don't know what MAR is, but typically your
program counter
(AKAinstruction pointer
) register is big enough to address all the program memory. Typically.The original i80x86 CPUs have the instruction pointer effectively split into 2 pieces, a segment selector and offset. The actual address that goes onto the address bus when accessing the physical memory is formed using these 2 pieces. In the so-called real addressing mode, the address is simply
segment selector * 16 + offset
. These 2 pieces are 16-bit and this addressing scheme lets you access about 1MB of memory. If you only changed the instruction pointer and never the segment, you'd be constrained to 64KB. There are other processors with split instruction pointers. Texas Instruments' TMS320C54xx, for example.Going back to the x86... On 64-bit x86 CPUs your instruction pointer is 64-bit long. However, the CPU may not (and I think still doesn't) support full 64-bit memory addresses, using only the low 52 or so bits. This is an example where the instruction pointer is larger than necessary to access all of the memory.
这完全取决于硬件设计者的想法。
This completely depends on the whims of the hardware designer.