xls10 wrote:
Oh I see. I'm just starting to learn how to write assembly callable from C and all of the examples I've seen have that function preamble which includes push ebp. In what cases would absolutely need to have it? Would it be when the function needs to use variables local to the called function? Thanks for the reply though!
For your assembly function to be callable from C, you essentially need to respect your compiler's ABI. That means that if you're using the SYSV ABI, you need to respect it(saving the registers specified by the ABI, for example).
But yeah, I think you can access local variables without ebp. If I recall correctly, it's only for debugging purposes(take that with a grain of salt though).