From: notsaying@nospicedham.127.0.0.1   
      
   On Thu, 21 Jan 2021 07:23:48 GMT, bilsch01    
   wrote:   
      
   > I read the x86 instruction reference. It is clear to me that pusha   
   > will decrement sp by 16. But it sounds like popa will increment sp by   
   > only 14. Is that correct?   
   >   
      
   Hardly likely is it? It would break a lot of things; after 'popa' SP is   
   set to the pre 'pusha' value; even though a value for SP is put on the   
   stack by 'pusha', it's ignored on restore.   
      
   > The text of the reference for popa says:   
   >   
   > Pops doublewords (POPAD) or words (POPA) from the stack into the   
   > general-purpose registers. The registers are loaded in the following   
   > order: EDI, ESI, EBP, EBX, EDX, ECX, and EAX (if the operand-size   
   > attribute is 32) and DI, SI, BP, BX, DX, CX, and AX (if the operand-   
   size   
   > attribute is 16). (These instructions reverse the operation of the   
   > PUSHA/PUSHAD instructions.) The value on the stack for the ESP or SP   
   > register is ignored. Instead, the ESP or SP register is incremented   
   > after each register is loaded.   
   >   
   (this is internal, you don't get to see the value of SP until pusha/pop   
   has completed)   
   >   
      
      
      
   --   
   Bah, and indeed, Humbug.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|