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 3,734 of 4,675   
   James Harris to R.Wieser   
   Re: Locals, parameters, callee-save regi   
   02 Jan 19 18:21:12   
   
   From: james.harris.1@nospicedham.gmail.com   
      
   On 02/01/2019 07:50, R.Wieser wrote:   
      
   ...   
      
   > @OP:   
   > The same came to my mind.   Being able to easily discard local (and pushed   
   > in the function itself) data without getting into problems with the saved   
   > registers does seem sensible.   Never found why its not done that way   
   > though.   
      
   Interestingly, it is compatible with Intel's ENTER and LEAVE   
   instructions. One could write   
      
         
      enter ,    
      ...   
      leave   
         
      ret   
      
   It's almost as though Intel intended stack frames to be laid out this   
   way. :-)   
      
   I never use ENTER but from the description it seems to do the following.   
      
      push ebp   
      pushes of nested frame pointers, if any are requested   
      mov ebp,    
      sub esp,    
      
   And LEAVE does   
      
      mov esp, ebp   
      pop ebp   
      
   https://css.csail.mit.edu/6.858/2014/readings/i386/ENTER.htm   
   https://css.csail.mit.edu/6.858/2014/readings/i386/LEAVE.htm   
      
      
   --   
   James Harris   
      
   --- 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