public void TestAddSymbols() { var symfile = ".label MyLabel=$0801\n.label YourLabel=$c000\n .label OurLabel=49152"; var sf = new SymbolFile(symfile); Assert.AreEqual(2049, sf.SymbolToAddress("MyLabel")); Assert.AreEqual(49152, sf.SymbolToAddress("YourLabel")); Assert.AreEqual(49152, sf.SymbolToAddress("OurLabel")); }
public void TestNamespaces() { var symfile = ".label NonNamespacedLabel=$400\n.namespace kernal {\n .label NamespacedLabel=$ffff\n}\n.label AnotherNonNamespacedLabel=$0800"; var sf = new SymbolFile(symfile); Assert.AreEqual(1024, sf.SymbolToAddress("NonNamespacedLabel")); Assert.AreEqual(65535, sf.SymbolToAddress("kernal.NamespacedLabel")); Assert.AreEqual(2048, sf.SymbolToAddress("AnotherNonNamespacedLabel")); }