【发布时间】:2014-11-30 09:45:44
【问题描述】:
我想学习如何用汇编语言(摩托罗拉 68k)映射数组。
我正在尝试将数据寄存器 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
你们能帮帮我吗?
谢谢!
【问题讨论】: