#11129 - Lupin - Fri Sep 26, 2003 7:45 pm
I want to write an function which uses more then just 11 registers (I think that's the amount of registers I could use freely, right?), so I have to use the stack. I know I could use....
stmfd sp!,{r10-r12,r3}
...to store r10-r12 + r3 onto the stack...
....and....
ldmfd sp!,{r10-r12,r3}
...to load r10-r12 + r3 from my stack
But the problem is, the ldm instruction would of course overwrite my current values of r10-r12,r3, but I need to save these values on another position of the stack.
Could someone please explain me how I could do all this? An stm/ldm example using offsets would be cool, so that I could free like 8 bytes for 1 data set and access these 8 bytes directly and have another data set which is like 16 bytes big and which I could access directly too.
This stack thing is pretty confusing...
stmfd sp!,{r10-r12,r3}
...to store r10-r12 + r3 onto the stack...
....and....
ldmfd sp!,{r10-r12,r3}
...to load r10-r12 + r3 from my stack
But the problem is, the ldm instruction would of course overwrite my current values of r10-r12,r3, but I need to save these values on another position of the stack.
Could someone please explain me how I could do all this? An stm/ldm example using offsets would be cool, so that I could free like 8 bytes for 1 data set and access these 8 bytes directly and have another data set which is like 16 bytes big and which I could access directly too.
This stack thing is pretty confusing...