| |||||||||
| |||||||||
One of the crucial issues in developing a stable and robust assembly language program is conflict of using register between calling program and the called procedure. Because registers are processor's resources shared together by calling program and the called procedure, then it makes sense that many times called procedure may modify the content of some registers that are still being used by the calling program. The customary solution is to preserve registers before the procedure performs its main job and to restore the register values after its completion. There are two ways to preserve registers:
However, employing the register preservation carelessly causes performance degradation considerably. It could be time-consuming and it increases the amount of code. Thus, it is the programmer's responsibility to find the best trade-off. |