Arrays 在地址寄存器汇编语言中向地址添加数字

Arrays 在地址寄存器汇编语言中向地址添加数字,arrays,assembly,Arrays,Assembly,我想学习如何用汇编语言(Motorola68K)映射数组 我试图将数据寄存器D1中的一个值移动到内存中,而要将这些值移动到的内存中的地址保存在A1中。另外,值得一提的是,A1地址指向一个声明的存储,大小为500字节,这对于我想做的事情应该有足够的空间。我尝试以下方法: moveq #0,D1 *moves value of 0 into D1 loop: cmpi.w #10,D1 *checks if D1 is less than 10, else branch out t

我想学习如何用汇编语言(Motorola68K)映射数组

我试图将数据寄存器D1中的一个值移动到内存中,而要将这些值移动到的内存中的地址保存在A1中。另外,值得一提的是,A1地址指向一个声明的存储,大小为500字节,这对于我想做的事情应该有足够的空间。我尝试以下方法:

moveq     #0,D1 *moves value of 0 into D1

loop:

cmpi.w    #10,D1 *checks if D1 is less than 10, else branch out to done
bge       done

move.w    D1,(A0) *moves 0 into address that A0 points to 



*then I get stuck here. I want to increment the address value ++ 
*(or whatever size I have to, which I am guessing is 1 word, since I am using words), so 
*that my values in memory are contiguous up to ten in memory, 
*such as 00 01 02 03 04 05 06 07 08 09 0a



addq.w    #1,D1  *D1 incremented by 1
bra       loop  *branch to loop again

done:

      break
你们能帮帮我吗


谢谢大家!

68k有一个递增后寻址模式,您可以使用尾随的
+
指定该模式,如中所示:

move.w    D1,(A0)+
引用M68000程序员参考手册:

使用操作数地址后,根据操作数的大小分别递增1、2或4:字节、字或长字


如果可以的话,你能帮我解决这个问题吗?非常感谢。