Each ARM instruction is
encoded (= represented) in
32 bits
Here is the encoding
of the ARM instructions:
Example 1:
The instruction
add r1, r2, r3(r1 = r2 + r3) is
represented (encoded) as:
11100000100000100001000000000011
Break down
the bit pattern
according to Data processing instruction type:
Cond 00 I OpCo S SrR1 Dest Operand-2
----------------------------------------------------
1110 00 0 0100 0 0010 0001 000000000011
^ ----- ^ ---- ---- ------------
| add | r2 r1 reg #3
I S
Cond 1110 mean: don't set the conditional flags (explained later)
I = 0 means: use Operand-2 as a register number
Example 2:
The instruction
add r1, r2, 3(r1 = r2 + 3) is
represented (encoded) as:
11100010100000100001000000000011
(The only difference between this and the previous instruction is the red 1 bit
)
Break down
the bit pattern
according to Data processing instruction type:
Cond 00 I OpCo S SrR1 Dest Operand-2
----------------------------------------------------
1110 00 1 0100 0 0010 0001 000000000011
^ ----- ^ ---- ---- ------------
| add | r2 r1 int value 3
I S
I = 1 means: use Operand-2 as an integer value
Note:
You don't need to know how
each computer instruction is
encoded !!!
I just want to show you that
every instruction/command that
a computer executes is
represented by
a unique bit pattern