Hopefully another simple question. :toothy When this is run, the local vars "toggle" and "once" are not zero and the compare jumps when it should not. Is the PushAD causing this, or are local vars not always preset to 0?
LowLevelFun Proc Private lpDest:DWORD, lpSource:DWORD
LOCAL toggle:BYTE
LOCAL once:BYTE
PushAD ; save regs
Xor Ecx, Ecx
Xor Edx, Edx
Xor Esi, Esi ; es,fs,gs = 386+ spare regs but cannot use, si/di instead
Mov Eax, lpSource ; get handle of source string into eax
Mov Ebx, lpDest ; handle for destination string in ebx
startit:
cmp toggle,0 ; which thing are we doing?
jnz do2ndthing ; we're doing the second thing
; else do first thing here
do2ndthing:
; do second thing, etc.
Mark,
Any variables you define on the stack "inherit" the value on the stack where the variable is located. Basically, you should consider stack/local variables unitialized at define time. If you want them to be a certain value, set them to that.
Relvinian
Good to know, thanks! :U