From: james.harris.1@nospicedham.gmail.com   
      
   On 03/01/2019 21:12, Rod Pemberton wrote:   
   > On Thu, 3 Jan 2019 07:31:34 +0000   
   > James Harris wrote:   
   >   
   >> Speaking of which, to make sure practice matched theory I changed my   
   >> recently written Nasm procedure entry and exit macros to push   
   >> callee-saves before EBP - and it works. No surprise, I guess, but   
   >> it's good to prove it with some real code. FWIW, with six x86-32   
   >> registers saved (all except EAX and ESP) that places the first real   
   >> argument at EBP+28.   
   >>   
   >   
   > So, you now have a basis of comparison - albeit limited - which could   
   > be used to provide a preliminary answer your own question.   
   >   
   > Other than a reordering of instructions and stack items, is there any   
   > advantage or disadvantage between the two methods?   
   >   
   > Since that test was so easy, is there any reason why you can't attempt   
   > another dozen configurations on your own?   
      
   Hi, Rod. I am not sure what else you think should be compared. Perhaps   
   you think my question was about broader issues than it was. As stated,   
   though, the question was about the specific issue of where to place   
   locals and callee-saves.   
      
   JH> This is a query about how best to lay out an x86 activation   
   JH> record which has to contain locals and callee-save registers.   
      
   and   
      
   JH> My query, though, is over where and how it is best to add   
   JH> the preservation of callee-save registers....   
      
   and   
      
   JH> if given free rein on x86 how would you recommend storing   
   JH> callee-save registers and locals while providing convenient   
   JH> access to stack-based parameters?   
      
   I have an answer: save other callee-save registers before saving EBP,   
   and locals afterwards, and as I mentioned I have implemented it in my   
   code. Job done. :-)   
      
   Insofar as there were broader issues I received some interesting and   
   useful answers such as having a fixed block, stable ESP and indexing off   
   ESP.   
      
      
   --   
   James Harris   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|