<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Assembler not accepting hex constants that include '0b' or '0B' as first characters in intel syntax"
href="https://llvm.org/bugs/show_bug.cgi?id=27884">27884</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assembler not accepting hex constants that include '0b' or '0B' as first characters in intel syntax
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>MC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>douglas_yung@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the following assembly code:
.intel_syntax
add rax, 0A0h
add rax, 0a0h
add rbx, 0B0h
add rbx, 0b0h
Both lines are in intel syntax and add a hexadecimal constant to the value in a
register. However, when you try to compile this using clang, you get an error:
reduced3.asm:4:14: error: unknown token in expression
add rbx, 0B0h
^
reduced3.asm:5:14: error: unknown token in expression
add rbx, 0b0h
^
(The carat points to just after the 'h' character if it gets mangled). I
suspect this is because the function AsmLexer::LexDigit() in AsmLexer.cpp i
parsing assuming AT&T syntax and gets confused. Prior to the change in r263802,
the compiler was correctly accepting the constant when it was '0B', but after
that change, both are causing errors.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>