is there any downsides/dangerous to using uses? and what registers does the winapi preserve?
dangerous: why? all it does is automatically push and pop the registers
downside: I'm not sure if using "option prolog:none" changes things
winapi: saves ebx,esi,edi,ebp
Cube,
It works OK, just sppecify the registers you want preserved and it will automatically di it for you but there is a down side, if you have multiple exits from the procedure, it write multiple copies of the stack balancing code which may not be what you want in terms of size. I always do my own manually.
Quote from: sinsi on October 12, 2009, 07:35:52 AM
downside: I'm not sure if using "option prolog:none" changes things
It does. No pushn & poppin with PROLOGUE:NONE... check yourself
include \masm32\include\masm32rt.inc
MyProc PROTO: DWORD, :DWORD, :DWORD
.code
start: int 3 ; greetings to Olly
invoke MyProc, 123,456, 789
exit
OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE
MyProc proc uses esi edi ebx arg1_:DWORD, arg2_:DWORD, arg3_:DWORD
ret 4*3
MyProc endp
MyProc_END: ; label for csize macro
OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
I used to have a macro (xpush/xpop) so you could use "xpush ebx,esi,edi" on one line
Quote from: jj2007 on October 12, 2009, 07:42:44 AM
It does. No pushn & poppin with PROLOGUE:NONE... check yourself
Thought so. I was just too lazy to test it...
i am not sure the api keeps the direction flag cleared, but it should be included in the list with ebx, esi, edi, ebp
you are expected to keep it cleared