It remains 16-byte-aligned if it is already 16-byte-aligned. (Also you can't push x1 - x3, but you can push ra, s0, s1.) The instruction doesn't force stack alignment, it just always adjusts sp in multiples of 16.Thanks for your response.
So if I push x1-x3 the stack gets aligned to 16 bytes.
YesThere is an empty 4 byte space at the bottom of the stack.
No, because cm.pop backs out all of the steps of cm.push in reverse. It loads from exactly the addresses where cm.push stored.If I pop x1-x3 X1 is filled with random junk and my stack is all out of whack.
You can push ra, plus any number of registers in s0 through s11 (except you can't push exactly eleven of them, for encoding reasons)I suppose my objection/ confusion is that you basically need to push/pop multiples of 4 registers.
Nope, it's a count, not a bitmapBut the encoding wastes space allowing you to do arbitrary push pops. A matching push and pop shouldn't do unexpected things.
Statistics: Posted by LukeW — Tue Nov 05, 2024 3:45 pm