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,546 of 4,675   
   Bernhard Schornak to Robert Prins   
   Re: Converting MMX to XMM [was: XSAVE ar   
   18 Sep 18 12:07:46   
   
   From: schornak@nospicedham.web.de   
      
   Robert Prins wrote:   
      
      
   > On 2018-09-17 20:53, Bernhard Schornak wrote:   
   >> Robert Prins wrote:   
   >>   
   >>> Tried x65dbg, and tracing into Windows is OK, XMM's are ok, until I hit a:   
   >>>   
   >>> 74AF2320 | EA 1E27AF74 3300         | jmp far 33:74AF271E      
                    |   
   >>>   
   >>> which doesn't want to be traced, and which comes back with XMM0, yes, set   
   to zero.   
   >>   
   >> If your far jump calls a HLL function, XMM0 is a 'volatile'   
   >> register. If you need its content after that function call,   
   >> you have to preserve it prior to the call and restore it on   
   >> re-entry (or use XMM6 ... XMM15).   
   >   
   > The far jump jumps into Windows itself, and I would expect an OS not to   
   touch my registers.   
      
      
   https://en.wikipedia.org/wiki/X86_calling_conventions#Register_preservation   
      
   There are no rules for handling XMM registers for x86-32   
   bit code, so any called function is free to use them for   
   calculations or other tasks without preserving/restoring   
   them. "cdecl" also states ST0...ST7 (aka MM0...MM7) must   
   be emptied (or cleared) on exit, so some compilers might   
   clear XMM0...XMM7, as well (if avalable...).   
      
   https://msdn.microsoft.com/en-us/library/ha59cbfz.aspx   
      
   Windows' x64 calling convention leaves XMM0 through XMM5   
   for free use ('volatile'), while XMM6 through XMM15 must   
   be restored on exit.   
      
   To avoid clobbered registers you might consider to use a   
   wrapper which preserves and restores volatile registers.   
      
      
   Greetings from Augsburg   
      
   Bernhard Schornak   
      
   --- 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