News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Is EBP a protected register?

Started by CCurl, October 17, 2015, 12:02:52 AM

Previous topic - Next topic

CCurl

Quote from: KeepingRealBusy on October 18, 2015, 06:49:59 AM
Quote from: CCurl on October 17, 2015, 04:56:41 AM
Excellent info. So long I can be confident that EBP isn't going to change out from under me when calling routines, I'm good.

Thanks.

Just one moment. Are you putting anything into EBP and expecting it to be present when you return from a library routine? How do you preserve what is in EBP as you enter your function?

Dave.
Isn't protecting the registers the responsibility of the code being called, not the code making the call? The caller cannot depend on EAX, EDX, or ECX retaining their values, but the other registers are supposed to be restored to their original values upon return.

jj2007

Dave & CCurl,

Don't argue :eusa_naughty:

Especially when you essentially agree:
yes you can change ebp (but caution with the locals),
yes you have to restore it before the ret.