private ASMAddLabelResult AddLabelGeneric(uint pc, string label) { ASMAddLabelResult result = new ASMAddLabelResult(); try { label = ASMStringHelper.RemoveSpaces(label).ToUpper(); if (!PersistentLabelDict.ContainsKey(label)) { LabelDict.Add(label, pc); if (label.StartsWith(PersistentLabelPrefix)) { PersistentLabelDict.Add(label, pc); } } else { PersistentLabelDict[label] = pc; LabelDict[label] = pc; } } catch { result.ErrorCode = 1; result.ErrorMessage = "Error adding label " + label + ": Label already exists!\r\n"; return(result); } result.ErrorCode = 0; result.PC = pc; return(result); }
public void ClearLabelDict() { LabelDict.Clear(); foreach (KeyValuePair <string, uint> pair in PersistentLabelDict) { LabelDict.Add(pair.Key, pair.Value); } }