简体   繁体   中英

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. The line are...

(R3)+

+(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. Thanks.

The assembly language is 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.

What the (Rn) means typically is "indirect using the address in register N".

What +(RN) means, typically is "add one (storage unit) to register N, and then go indirect using the address in register N". What (RN)+ means, is "go indirect on the address in register N, and when done, add one (storage unit) to register N". -(RN) and (RN)- are analogs that "subtract one (storage unit)".

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.

The PDP-11 also allowed addressing with an offset to a register, eg, "k(RN)". DSPs may or may not allow this.

Yes, the details should be easily found in any programming manual for the device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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