hi guys
i have a questions to push/pop
use a subroutine with registers must I set the registers with push and pop?
example:
subroutine proc
push esi
inc esi
...
...
..
pop esi
ret
subroutine endp
greets
ragdog
Quoteuse a subroutine with registers must I set the registers with push and pop?
"set" ???
Do you mean save ?
Form the sample code ... if you are setting 'esi' before the function is called, at the end of the function it has been reset to the same.
-
Shantanu
hi
yes i mean save ::)
i uses esi ebx register in my wndproc and call then the subroutine
if I in the subroutine registers not save with push then does not work the routine my ask was if I with register work must I always the registers save with push
sry for my english
greets
ragdog
esi edi ebx must be preserved otherwise you may encounter errors. Masm offers "uses" keyword which simplifies the preservation. You won't have to worry about the order with which registers needs to be popped.
Just use it like this
YourProc uses esi ebx proc
.
.
.
YourProc endp
thanks for your reply and info
greets
ragdog