What is the equivalent instruction for PUSH{lr}
and POP{lr}
in ARM Arch64 instruction set .
Is STR X30, [SP, #8]
correct ? could y
If you ask the C compiler to generate an assembly language listing from your source, you'll see how it handles pushing data on the stack for ARMv8. This might not be the only way to do it, but GCC does it this way:
sub sp, sp, #32 \\ Open up some temp stack space
stp x19, x20, [sp] \\ save 2 pairs of registers
stp x21, x30, [sp,#16]
ldp x19, x20, [sp] \\ restore 2 pairs of registers
ldp x21, x30, [sp,#16]
add sp, sp, #32 \\ "free" the temp stack space