如何交换到地址中的值。目前我有 2 个包含地址的寄存器。然后我有 2 个临时变量来存储这些地址。然后我加载了值,因为我有地址。但我不知道如何交换值。我正在尝试进行冒泡排序。下面的代码是我目前拥有的
IF ;swapping condition
ST R2,idata ;temporily hold the smaller data
ST R1,imindata ;temporaily hold the larger data
ST R2,iminaddres ;store the values into that address
ST R2,iaddress ;finish the swaping of the two values
LD R1,iminaddres ;reput the address back into the register
LD R2,iaddres ;reput the address back into the register to be used for next cycle