简体   繁体   English

在汇编语言中,行(r3)+有什么作用?

[英]In assembly language what does the line (r3)+ do?

I have some lines in assembly that I must be able to answer what the Effective Address (EA) of it is. 我在汇编中有一些行,我必须能够回答它的有效地址(EA)。 The line are... 这条线是......

(R3)+ (R3)+

+(R2) +(R2)

What do the plus signs do here? 这里的加号有什么作用? I know that (R3) would have an EA = [R3], but I do not understand the + signs and cannot find an answer anywhere. 我知道(R3)会有EA = [R3],但我不明白+符号,无法在任何地方找到答案。 Thanks. 谢谢。

The assembly language is NIOS II 汇编语言是NIOS II

This notation is common in assembly code on machines that do indirect addressing through registers, originally the PDP-11 but these days, I think a lot of DSPs. 这种表示法在通过寄存器进行间接寻址的机器上的汇编代码中很常见,最初是PDP-11,但是现在我认为很多DSP。

What the (Rn) means typically is "indirect using the address in register N". (Rn)通常意味着“间接使用寄存器N中的地址”。

What +(RN) means, typically is "add one (storage unit) to register N, and then go indirect using the address in register N". +(RN)的含义通常是“将一个(存储单元)添加到寄存器N,然后使用寄存器N中的地址间接进行”。 What (RN)+ means, is "go indirect on the address in register N, and when done, add one (storage unit) to register N". 什么(RN)+表示“在寄存器N中的地址上间接,并且在完成时,将一个(存储单元)添加到寄存器N”。 -(RN) and (RN)- are analogs that "subtract one (storage unit)". - (RN)和(RN) - 是“减去一个(存储单元)”的类似物。

The notation, IIRC, was originally used on the PDP-11 in very early 1970s, and a variant climbed into the C language in the form of ++, -- and * operator combinations. IIRC的符号最初是在20世纪70年代早期用于PDP-11的,并且变体以++, - 和*运算符组合的形式进入C语言。

The PDP-11 also allowed addressing with an offset to a register, eg, "k(RN)". PDP-11还允许以寄存器的偏移进行寻址,例如“k(RN)”。 DSPs may or may not allow this. DSP可能允许也可能不允许这样做。

Yes, the details should be easily found in any programming manual for the device. 是的,详细信息应该可以在设备的任何编程手册中找到。

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

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