From 6a5f4c18e693ceaec66c253c657203b24c59ea4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Sat, 30 Oct 2021 05:53:45 +0300 Subject: [PATCH] Updated RemoveLeading() to use with 1x prefixes --- src/Extensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Extensions.cs b/src/Extensions.cs index 8d9101b..724030e 100644 --- a/src/Extensions.cs +++ b/src/Extensions.cs @@ -16,14 +16,14 @@ namespace processor } /// - /// 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 /// /// /// internal static string RemoveLeading(string text) { - if (text.Contains("0x")) return text.Remove(0, 2); - MessageBox.Show("Error while parsing code:\nHexadecimal instruction codes must start with \"0x\"!", "Vole Language Parser"); + if (text.StartsWith("0x") | text.StartsWith("1x")) return text.Remove(0, 2); + 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 ""; }