ARM stack full/empty, increasing and decreasing concept

  Today I learned the programming of embedded systems and came across the concept of stack. It's easier to confuse, I write this to distinguish (I only learned one kind of ARM, I don't know if the other types are the same, if you know, please tell me~).
  Let me first talk about the classification of the stack:
  according to the different data locations pointed to by the stack pointer, the stack can be divided into a full stack and an empty stack

  Full stack: the stack pointer points to the last oneUsedThe address of the
  empty stack: the stack pointer points to the current firstNot used yetThe address (that is, use it when you save the next one!)

  The other is increment and decrement. You can always see "full increment, empty increment, full decrement".

  Increment: When the stack pointer pushes data, the address changes from low address to high address
  . When the stack pointer pushes data, the address changes from high address to low address.

  So the meaning of full increment is: the stack pointer points to the last data pushed, and the address changes from low to high. Attach a related exercise question:
Insert picture description here
Reference materials:

https://blog.csdn.net/haospark/article/details/80359116
https://blog.csdn.net/itworld123/article/details/88058118
https://blog.csdn.net/zilan23/article/details/104035689

Due to the limited level of the author, if there is any mistake, please point it out in the comment section below, thank you!

Guess you like

Origin blog.csdn.net/gls_nuaa/article/details/115281756