The stack memory allocation is performed in processor / RAM

advertisements

at present i am studying MIPS architecture, in which i came across subroutine calls, it says that the stack allocation takes place within the processor using the registers

Source for this

But i have also studied basic programming course in java. And if what i know is correct! "stack memory allocation during function calls takes place in RAM "

this i confirmed from stack overflow (2nd ans)

Can anyone tell me where my understanding is wrong and if yes why?

thanks in advance


The stack is directly in the RAM and as for most processors, MIPS have registers to help it move efficiently into the stack and keep track of the data. The two important processor registers for that are the stack pointer (points to the top of the stack) and the frame pointer (points to the current stack frame in the stack).