Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the abbriviations (Rn, Rd, ...) in the instruction set of ARM mean?

recently i checked the Instruction Set for an ARM Cortex-M3 processor. For example:

ADD <Rd>, <Rn>, <Rm>

What do those abbriviations mean exactly? I guess they mean different kinds of addresses, like directely addressed, relatively addressed or so. But what exactly?

Thanks!

like image 320
Bil_Bomba Avatar asked Jan 15 '16 19:01

Bil_Bomba


People also ask

What is RN in ARM?

The RN directive defines a name for a specified register.

What are the ARM instructions format?

The ARM instruction stream is a sequence of word-aligned words. Each ARM instruction is a single 32-bit word in that stream. The encoding of an ARM instruction is: Table 5.1 shows the major subdivisions of the ARM instruction set, determined by bits[31:25, 4].

What is RT ARM?

Surface tablets, come in two forms: Surface RT (the RT stands for Run Time) will use an Nvidia ARM processor, while the slightly larger but more powerful Surface Pro will run on an Intel's third-generation Core i5 CPU..

How long is an ARM instruction?

All ARM instructions are 32 bits long. Instructions are stored word-aligned, so the least significant two bits of instruction addresses are always zero in ARM state. Some instructions use the least significant bit to determine whether the code being branched to is Thumb code or ARM code.


2 Answers

Operands of the form <Rx> refer to general-purpose registers, i.e. r0-r15 (or accepted aliases like sp, pc, etc.).

I'm not sure if it's ever called out specifically anywhere but there is a general pattern of "d" meaning destination, "t" meaning target, "n" meaning the first operand or base register, "m" meaning the second operand, and occasionally "a" meaning an accumulator. Hence why you might spot designations like <Rdn> (in the destructive two-operand instructions), or <Rt>, <Rt2> (where a 64-bit value is held across a pair of GP registers). This is consistent across the other types of register too, e.g. VADD.F32 <Sd>, <Sn>, <Sm>.

like image 87
Notlikethat Avatar answered Oct 03 '22 01:10

Notlikethat


They are just there to define registers, the lowercase letter just being there to separate them for explanation. Rd is destination, but Rn, Rm etc are just any register you can use. It's the only way to tell which is which when explaining like "Rd equals Rn bitwise anded with Rm", for example, since you can't use numbers.

They could be Rx, Ry etc, or Ra, Rb... as well.

like image 37
Sami Kuhmonen Avatar answered Oct 03 '22 01:10

Sami Kuhmonen