This is an example assembly code:
function0()
0x0.mov r0, #1
0x8.mov r1, #20
0x10.mov r2, #6
0x18.cmp r1, #16
0x20.b function1
function1()
0x28.cmp r0, #1
0x30.b functionX
functionX()
0x38.bx lr
As far as I know, function0
moved those values into the first 3 registers. In function1
no values were moved into registers.
What I don't understand is:
after branching to
function1
do registersr1
andr2
still have those values or those registers have been zeroed out?After branching to
functionX
, is the link register still the same as the one in function0?