0 votes
in General Knowledge by (744k points)
What are callee/caller saved registers?

How does a caller saved register work?

How does a callee saved register work?

1 Answer

0 votes
by (744k points)
 
Best answer
It's a convention in place to split up value saving responsibility between caller and callee methods.

IF the register contains data needed by the Caller after the Callee function returns, the Caller function must preserve them by pushing them to the stack prior to calling the Callee function. Caller then pops them from the stack after Callee returns.

IF the the Callee function wishes to use these registers , the Callee function must push them to the stack prior to using them. Callee must assume there is data in each of these registers that is important to the Caller function. Callee function must pop these registers back prior to returning to the Caller.
Welcome to the Answerine , a great place to find, read and share your favorite questions and answers.
...