例如,PowerPC 书 I,第 3.3.2 节将 lbz
指令定义为:
Let the effective address (EA) be the sum (RA|0)+ D. The byte in storage addressed by EA is loaded into RT56:63. RT0:55 are set to 0.
以下两种情况我该怎么办?
- 当
(RA) + D > memory_capacity
时,我应该换行或执行某些操作吗? - 当
(RA) + D > 4294967295
时我应该换行或执行某些操作吗?
换句话说,有效地址只是(RA) + D
之和,还是计算完成mod memory_capacity
或mod 2^32 -1
?
相关实用 Material :this script中设置var EA
的每一行.
最佳答案
来自 Power ISA 2.06 书籍,第 1.9.3 节有效地址计算
In 32-bit mode, the low-order 32 bits of the 64-bit result, preceded by 32 0 bits, comprise the 64-bit effective address for the purpose of addressing storage. [...] As used to address storage, the effective address arithmetic appears to wrap around from the maximum address, 232-1, to address 0, except that if the current instruction is at effective address 232-4 the effective address of the next sequential instruction is undefined.
关于assembly - PowerPC 中应该对有效地址 'wrap' 求和吗?如果是这样,怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6087305/