Professional Documents
Culture Documents
(A) (B)
Unconditional Conditional
branching branching
Instruction: Instruction:
BEQ BGE BCS
B - branch BNE BGT BCC
BL – branch link BLE BMI BVS
BLT BPL BVC
(A)
Unconditional branching
Instruction:
B – branch BL – branch link
Syntax:
B label BL label
Instruction:
BEQ BGE BCS
BNE BGT BCC
BLE BMI BVS
BLT BPL BVC
5.2 Understanding Flag in APSR
Example:
CMP R3, #3
BGT mul_5 ;goto mul_3 (label) when
(R3) is greater than #3
(Z=0 & N=V)
DIVS R0,R2,R1 ;if not, perform
R0=R2/R1
B END
mul_5 MULS R0,R2,R1 ;perform R0=R2*R1
END
Try It Yourself
YES
15
2 - 163
END
Try It Yourself
Write a assembly
program to solve the
algebraic problem
below. Then, draw the
flow chart to express
the problem:
THE END