2 Calling Convention

A calling convention is the way a function in a program calls another function. The compiler handles this automatically, but, if a function is written in assembly language, the user must know where and how its parameters can be found, how to return to the program location from where it was called, and how to return the resulting value. It is also important to know which registers an assembler-level routine must preserve. If the program preserves too many registers, the program might be ineffective. If it preserves too few registers, the result would be an incorrect program.