简体   繁体   English

68k ASM寻址模式

[英]68k ASM addressing modes

I learned some 68k/Coldfire at the Uni, and having difficult understanding the more complex addressing modes (with the numbers near the parentheses of dereference). 我在大学学习了68k / Coldfire,并且难以理解更复杂的寻址模式(数字靠近取消引用的括号)。

I think example are the best here: 我认为最好的例子是:

A) lea:
A1) lea $5(a1,a2.l), a0
A2) lea -1(a1,a2), a0

B) move:
B1) move.b 1(a1),d0
B2) move.b -2(a1),d0

Could anyone please explain me in plain words what happends in each instruction? 谁能用简单的语言解释我,每条指令中发生了什么?

Please elaborate more if needed (pre/post incrementations, etc.). 如果需要,请详细说明(增加/增加前后等)。

Thanks!! 谢谢!! ;) ;)

Ad lea instructions: 广告说明:

  • A1) A0 will be set to A1+A2+5 A1)A0将设置为A1 + A2 + 5
  • A2) A0 will bet set to A1+A2-1 A2)A0将下注设置为A1 + A2-1

As the name of the lea instructions implies, it is used to load an address into an address register. 正如lea指令的名称所暗示的那样,它用于将地址加载到地址寄存器中。 It will not move data from indirect addressing. 它不会从间接寻址中移动数据。 I haven't checked if those instructions are valid and my 68k skills are quite rusty now, so I assume they are. 我尚未检查这些说明是否有效,我的68k技能现在还很生锈,所以我认为它们是有效的。 Not specifying the index register width in A2 introduces ambiguity. 不指定A2中的索引寄存器宽度会引起歧义。 From the top of my head I cannot recollect if .W or .L was the default register width here, so specifying that might be a good idea. 从我的头顶开始,我无法回忆起.W或.L是此处的默认寄存器宽度,因此指定它可能是一个好主意。

Ad move instructions: 广告移动说明:

  • B1) D0 will be set to the byte that immediately follows the address stored in A1. B1)D0将被设置为紧随A1中存储的地址之后的字节。 Eg if A1 is set to $1000, the byte that will be read is the one at address $1001. 例如,如果A1设置为$ 1000,则将读取的字节为地址$ 1001的字节。
  • B2) As in B1, but the content will be readm from 2-bytes ahead the A1 address. B2)和B1一样,但是将从A1地址前面的2个字节读取内容。 Again assuming A1 will be preloaded with $1000, the byte that will be read is the one at location $FFE. 再次假设A1将预加载$ 1000,将读取的字节为$ FFE位置的字节。

For completeness, the addressing modes are: 为了完整起见,寻址模式为:

  • A1) Register indirect with index and displacement A1)用索引和位移间接注册
  • A2) dito A2)dito
  • B1) Register indirect with displacement B1)用位移量间接注册
  • B2) dito B2)dito

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM