•The function that called main may use EDI register
(group 1) so it is saved
•Other group 1 registers are saved because without
optimization compiler emits standard
code (saves all group 1 registers, standard prolog/epilog, etc.)
•
•int
mainCRTStartup (/*…*/)
•{
• // may use group 1 registers (EDI,
…)
• main(/*…*/);
• // may continue use group 1
registers (EDI, …)
•}
•
•int
main(/*…*/)
•{
• // saves group 1 registers if it
uses them (EDI, …)
• // uses group 1 registers
• // restores group 1 registers (if
saved)
•}
•