> "memory" clobber is missing (I agree that this is not obvious!)
Sorry, it's my first 'patch' post and I wasn't sure what was appropriate 
to include.  Didn't want the thing to be too cluttered.

There are actually 4 things changed:

1) The memory clobber.  This is the key change.  There is an non-inline 
version of __stosb elsewhere which works correctly because it's 
"call"ed.  But if you are using the inline asm version in winnt.h, it 
must have the clobber to ensure it works correctly.

2) I have changed Dest and Count from input+output to just inputs. 
Saying they are outputs when they aren't puts unnecessary constraints on 
the compiler.

3) By using %z2 in the instruction template, the compiler will generate 
correct assembly whether the code is compiled with -masm=att (the 
default) or -masm=intel.  While I expect that most people are going to 
use the default, it seems like system headers should support both.  
Especially in the Windows world, where people may be more used to 
working with intel format.  We wouldn't want to get people in a position 
where someone needs to include windows.h which requires att, and some 
other library header which requires intel.

4) Removed the symbolic names (ie [Dest]) since they aren't being used.  
I'm a big believe in using symbolic names.  I think all inline asm 
should use them.  But only if it, well, uses them.

I suppose a fifth thing would be that by using a macro, the code is 
somewhat shorter, but that's just incidental.  It made things easier to 
change while I was experimenting.

dw

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to