Updated RemoveLeading() to use with 1x prefixes
This commit is contained in:
+3
-3
@@ -16,14 +16,14 @@ namespace processor
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes leading 0x prefix in hexadecimal instructions, only returning 4 char part
|
/// Removes leading 0x or 1x prefix in hexadecimal instructions, only returning 4 char part
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="text"></param>
|
/// <param name="text"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static string RemoveLeading(string text)
|
internal static string RemoveLeading(string text)
|
||||||
{
|
{
|
||||||
if (text.Contains("0x")) return text.Remove(0, 2);
|
if (text.StartsWith("0x") | text.StartsWith("1x")) return text.Remove(0, 2);
|
||||||
MessageBox.Show("Error while parsing code:\nHexadecimal instruction codes must start with \"0x\"!", "Vole Language Parser");
|
MessageBox.Show("Error while parsing code:\nHexadecimal CPU instructions must start with \"0x\" and ram write instructions must start with \"1x\"!", "Vole Language Parser");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user