assembly - PowerPC 中应该对有效地址 'wrap' 求和吗?如果是这样,怎么办?

标签 assembly powerpc

例如,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_capacitymod 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/

相关文章:

assembly - 除法导致括号不平衡

assembly - 哪种 32 位/64 位 CPU 架构的指令集最简单?

c - Green Hills Sw小数据区溢出

c++ - std::ios_base::Init::Init() 和 std::string::assign(std::string const&) 上的 SIGILL

opencv - 优化SIMD直方图计算

c - 汇编语言8085程序计算前20个偶数之和(8位)

assembly - 入门教程 : Assembler, 段错误

c - 将数字字符串汇编成 int

assembly - 十六进制中的NULL是什么

assembly - 如果没有比较指令,不相等如何分支?