SP
Jump to navigation
Jump to search
The stack pointer is an essential part of almost any CPU design. It points to a location in RAM used to store (push) or retrieve (pop) information from. On most CPUs, the Stack grows downwards, so a push operation decrements the SP, but there are also implementation where the stack grows, so a push increments the SP. When saying "incrementing" or decrementing, it should be noted that the SP usually handles items that are multiples of the processors natural size, so 4 byte items on a 32-bit processor, 2 byte items on a 16-bit processor. Usually, the SP also needs to be aligned accordingly.