ARM Architecture - Subroutines and Stack
Consider this ARM assembly snippet for a recursive factorial function:
What will be the value in R1 after calling
factorial:
CMP R0, #1
BLE end_factorial
PUSH {LR}
SUB R0, R0, #1
BL factorial
POP {LR}
MUL R0, R0, R1
end_factorial:
MOV R1, R0
BX LRWhat will be the value in R1 after calling
factorial with R0 = 3?