ARM instructions process data held in registers and only access memory with load and store
instructions. ARM instructions commonly take two or three operands. For instance the ADD
instruction below adds the two values stored in registers r1 and r2 (the source registers). It writes
the result to register r3 (the destination register).
Data Processing Instructions
The data processing instructions manipulate data within registers. They are move instruc- tions,
arithmetic instructions, logical instructions, comparison instructions, and multiply instructions.
Most data processing instructions can process one of their operands using the barrel shifter.
If you use the S suffix on a data processing instruction, then it updates the flags in the cpsr. Move
and logical operations update the carry flag C, negative flag N, and zero flag Z. The carry flag is
set from the result of the barrel shift as the last bit shifted out. The N flag is set to bit 31 of the
result. The Z flag is set if the result is zero.
Move Instructions
Move is the simplest ARM instruction. It copies N into a destination register Rd, where N is a
register or immediate value. This instruction is useful for setting initial values and transferring
data between registers.