In thinking about assembly-language programming and calling conventions, the distinction…
Private research annotation
Sign in to add a private research label or note.
- User
In thinking about assembly-language programming and calling conventions, the distinction between caller-saved and callee-saved registers can be a source of confusion. But even after being clear on the concepts, one thing I noticed my textbook didn't explain is "why?". Things would be easier to understand if we had the convention either that all registers be caller-saved, or that all registers be callee-saved. Why are calling conventions instead usually designed with a mixture of both types of register conventions?
Assistant
You've hit on a great question that gets to the heart of calling convention design! The mixed approach isn't arbitrary - it's actually an optimization that emerges from analyzing real-world function calling patterns.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.