LOCK prefix encoded by masm to an invalid instruction (causing #UD) - by internal access 54

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 738878 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 4/25/2012 5:32:06 PM
Access Restriction Public


masm ml.exe accepts 

lock bts eax, 2 

and assembles this instruction to F0 0F BA E8 02, although its  NOT available on any CPU.
Execution then leads to an #UD exception.

The LOCK prefix F0 is only allowed, if the FIRST operand is a MEMORY LOCATION. On registers,
this prefix is NOT allowed.

Sign in to post a comment.
Posted by Microsoft on 6/1/2012 at 1:44 PM
Thank you for using the Microsoft Macro Assembler (MASM). And thank you for contacting us.

The issue of the LOCK prefix being permitted on an instruction that does not have a memory operand as the destination has been fixed. The fix will be included in the next release.

Visual Studio (and MASM) Product Team
Posted by MS-Moderator10 [Feedback Moderator] on 4/26/2012 at 2:14 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 4/25/2012 at 5:54 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)