Quote:Original post by Rockoon1
btw, a decent compiler (or asm programmer) NEVER uses a stack frame.. ever.. if you cant figure out where things are relative to ESP/RSP then you are probably already dead in the water
GCC does for x86 IIRC, even with -O#, because it allows some minimal debugging and tracing. You have to explicitly pass -fomit-frame-pointer if you don't want them.
As for the OP's question, having EBP free probably wont get you much anyway, internally the processor has many more unnamed registers and will use them to side step write-after-read stalls, so you might be better off setting stack frames and making debugging easier if that is a requirement.
Edit:
Forgot about your other question re: hard coding the address. Which one is better depends on the context. The version with the entire address hard coded in the instruction will obviously be longer, and will probably decode into more micro-ops that break the instruction into 2 (or more) steps, loading the address from just after opcode, then loading the value from that address.
Used sparingly you can make life easier on yourself by using the hard coded one, but inside a loop you would be better off loading the address once outside the loop and using the other one.
[Edited by - outRider on October 10, 2007 11:51:40 AM]