Types of ARM instruction, The ARM processor uses 3 types of instructions :-
- Data Processing instruction
- Data Transfer instruction
- Flow control Instruction
Data Processing Instruction
Data Processing instruction are used for processing of data i.e, they are used mainly for some calculation.
The processing operation are again scheduled in two types :-
- Arithmetical Operation:-
The arithmetical instruction are mainly used for arithmetic operation like addition, Subtraction, Multiplication, Division etc.
2. Logical Operation:-
The logical instruction are mainly used to perform logical operations like AND, OR, NOT, XOR,etc.
Data Transfer Instruction:-
As the name suggest these type of instruction are used to transfer data between register and memory. These instruction used opcode like MV0, MV1,…..MVn, etc.
The data transfer instruction are sub divided into 3 types:-
1. Single Load Store Data transfer:-
Single load store data transfer is used to transfer data between register only. i.e, two registers are used for loading as well as storing the data.
2. Register to Memory Data transfer:-
These instruction are used to transfer data from register to memory and vice-versa. i.e, MOV R1 005#;
3. Multiple register Data transfer:-
It uses a number of register either at source or destination operand.
Ex – MOV R0(R1, R2, R3) R0<-R1+R2+R3
Flow Control Instruction:-
1. Unconditional Flow control instruction:-This type of instruction always change the sequence of program execution.
2. Conditional Flow Control Instruction:-Two types of instruction are used while a condition is satisfied. Such instruction are executed by ARM processor with a conditional environment.
For example, BC(Branch On Carrer), BZ(Branch On Zero).
Write a program:-
; This is the first assembly language.
; This is developed by XYZ.
;This program will add two number and produced the result.
AREA ADD CODE READONLY
MOV R0, #5 ;R0 <- 5
MOV R1, #4 ;R1 <- 4
ADD R2, R0, R1 ;R2 <- R0+R1