Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary integer literals incorrectly parsed as hex numbers in the "Constant" tooltip #139

Open
bplu4t2f opened this issue Jul 12, 2022 · 1 comment

Comments

@bplu4t2f
Copy link

It thinks a number with a b suffix (like 11101110b) is a hex number, but it is a binary number. At least in MASM64.

image

@HeartyYF
Copy link

HeartyYF commented Sep 13, 2022

// special case with trailing B: either this B is from a hex number of the Binary
if (str.EndsWith("B", StringComparison.Ordinal))
{
bool parsedSuccessfully_tmp = ulong.TryParse(str, NumberStyles.HexNumber, CultureInfo.CurrentCulture, out ulong dummy);
if (parsedSuccessfully_tmp)
{
isHex = true;
token2 = str;
}
else
{
token2 = str.Substring(0, str.Length - 1);
isBinary = true;
}
}

You can check this. AsmDude can't tell whether b is a part of a hex number or a mark of binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants