In fact ebp/rbp is used by the x86 architecture as the base pointer for the stack specifically in instructions enter and leave.
If the frame is managed only via esp/rsp with push, pop, call, ret and add/sub, then the ebp could actually be used on effect as an ordinary register. It also may have some nuances in how it appears in the addressing modes.
In general, addressing modes combined with opcode specific register uses can help infer optimal register allocation for a given task.
|