[Issue 988] DMD allows invalid LOCK prefix in inline assembler

kris foo at bar.com
Wed Feb 21 09:41:32 PST 2007


Sean Kelly wrote:
> d-bugmail at puremagic.com wrote:
> 
>>
>> The LOCK prefix can be prepended only to the following instructions 
>> and only to
>> those forms
>> of the instructions where the destination operand is a memory operand: 
>> ADD,
>> ADC, AND,
>> BTC, BTR, BTS, CMPXCHG, CMPXCH8B, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR,
>> XADD, and XCHG.
> 
> 
> Darnit, I dunno why I thought this was supposed to work.  It's not like 
> I haven't read this clause enough :-p  I'll use CAS instead.  Thanks!

Well, there's conflicting info out there so it's hardly surprising:

Here's just one page that says MOV is just fine :) 
http://www.cs.tut.fi/~siponen/upros/intel/instr/lock.html


More information about the Digitalmars-d-bugs mailing list