home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,298 of 4,675   
   Rod Pemberton to fy247@nospicedham.always.com   
   Re: pusha and popa changes to sp registe   
   21 Jan 21 17:26:29   
   
   From: nomailings@nospicedham.trgzxcqvbe.cpm   
      
   On Wed, 20 Jan 2021 23:23:48 -0800   
   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?   
   >   
   > 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.   
   >   
      
   They just didn't mention ESP/SP:   
   https://www.sandpile.org/x86/sframe.htm   
      
      
   Sandpile.org   
   https://www.sandpile.org   
   "The world's leading source for technical x86 processor information"   
      
   --   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca