简体   繁体   English

68k汇编 - 加上地址寄存器上的符号

[英]68k assembly - plus symbol on address registers

While reverse engineering something for fun, I came across the following piece of assembly: 在进行逆向工程以获得乐趣时,我遇到了以下装配:

move.b  (a1)+,(a0)+

I understand that the parentheses mean 'value of', but what does the plus symbol stand for? 我明白括号的意思是“价值”,但加号代表什么? How would I accurately translate this to C? 我如何准确地将其转换为C?

(a1)+ accesses memory at a1 and increments a1 by the size of the operation. (a1)+访问a1存储器,并按操作的大小增加a1 In this case 1. What you have looks like a part of a typical loop that copies memory. 在这种情况下1.您所拥有的内容看起来像是复制内存的典型循环的一部分。

The parentheses mean indirect addressing and the + means post-increment. 括号表示间接寻址, +表示后增量。 In this case both a1 and a0 will be increased by the size of the operation after the instruction is executed. 在这种情况下,执行指令后, a1a0都将增加操作的大小。 Another common addressing mode is indirect addressing with pre-decrement, -(An) . 另一种常见的寻址模式是具有预递减的间接寻址, -(An)

The typical use for a move instruction where indirect addressing with post-increment is used for both the source and destination register is to copy data from one memory location to another in a loop. 对于源寄存器和目标寄存器使用后递增的间接寻址的move指令的典型用法是将数据从一个存储器位置复制到另一个存储器位置。

The Programmer's Reference Manual is invaluable for any M68000 programmer. 程序员参考手册对于任何M68000程序员都是非常宝贵的。

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

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