This is a homework question. I’m trying to call a function of the form FOO(A,B,C,D,E,F). The first four parameters are in register r0-r3. The last two are in r7 and r6 (respectively) so they are backwards. How can I push the parameters onto the stack so they are in the correct order?
is it STMFD sp! {r0-r3} then STMFD sp! {r7, r6, lr}? I’m using a full descending stack.
Are the diagrams on this site correct because when it does STMFD r13!, {r4-r7} shouldn’t r4 be where r7 is if the lowest register gets stored first?
In ARM the order of the register list does not matter. It will always store starting from the lowest register (R0, R1, R2, …) The following are all equivalent (if accepted by the assembler):