Assembly C Python
1. CBZ --> Branch if Zero
e.g;
CBZ X9, L1
If X9 == 0, go toL1
2. CBNZ --> Branch if Zero
e.g;
CBNZ X9, L1
If X9 != 0, go to L1
3. B --> Unconditional Branch
e.g;
B L1
Jump to L1
4. SUB X9, X22, X23 --> Compare i and j If (i == j)
f = g + h;
CBNZ X9, Else --> if i !=j, jump to Else Else
f = g - h;
AD X19, X20, X21 --> f = g + h
B Exit --> Skip Else
Else:
SUB X19, X20, X21 --> f = g - h
Exit:
5. BR --> Return to caller
6. fact:
SUBI SP, SP, #16 // Allocate stack
space
STUR LR, [SP, #8] // Save return
address
STUR X0, [SP, #0] // Save argument n
SUBIS XZR, X0, #1 // Compare n with 1
B.GE L1 // If n >= 1, continue
ADDI X1, XZR, #1 // Return 1 for base
case
ADDI SP, SP, #16 // Restore stack
BR LR // Return
L1:
SUBI X0, X0, #1 // n = n - 1
BL fact // Recursive call
MUL X1, X0, X1 // Multiply n *
fact(n-1)
BR LR // Return
C:\Program Files (x86)\CodeBlocks\MinGW\bin
8 Bits = 1 Byte
We use the number of bits to get the location of an element in an array