|
From: Sharwan on 7 Aug 2008 04:24 Hi, I am a newbie learning assembly language. Somewhere I found that while initialization of global/text segment in program some authors do it like as shown below : enter 0,0 ; setup routine pusha and while exiting popa mov eax, 0 leave I am not able to understand why we enter 0,0 to stack . Any help in clarifying this doubt would be much appreciated. Best Regards Sharwan
From: Frank Kotler on 7 Aug 2008 05:42 Sharwan wrote: > Hi, > I am a newbie learning assembly language. Somewhere I found that > while initialization of global/text segment in program some authors > do it like as shown below : > > enter 0,0 ; setup routine > pusha > > > and while exiting > popa > mov eax, 0 > leave > > I am not able to understand why we enter 0,0 to stack . > Any help in clarifying this doubt would be much appreciated. Shorter than the explicit instructions. At one time (dunno if it's still true), "enter" was shorter, but slower, than the explicit instructions, but "leave" was shorter and equally fast... so you'd sometimes see: push ebp mov ebp, esp sub esp, ??? .... leave ret Mmmmm, y'know... looking at this... "enter" is only shorter if the first operand is non-zero... I don't know why anybody would use "enter 0, 0". Good question! Best, Frank
|
Pages: 1 Prev: time to leave? Next: announce: my very first disassembler now available (GPL) |