class SymbolSet():
    def __init__(self):
        self._address_labels = dict()
        self._label_addresses = dict()
        self._generic_id = 0

    def add_label(self, address, label):
        if address in self._address_labels:
            raise TargetRelabelException("{:#04X} has already been given the "
                "label {}".format(address, self._address_labels[address]))
        if label in self._label_addresses:
            raise LabelReuseException('The label "{}" is already used '
                'at {:#04X}'.format(label, address))

        self._address_labels[address] = label
        self._label_addresses[label] = address

    def add_generic_label(self, address):
        label = "label{:04}".format(self._generic_id)
        self.add_label(address, label)
        self._generic_id += 1

    def get_label(self, address):
        return self._address_labels.get(address, None)

    def get_address(self, label):
        return self._label_addresses.get(label, None)


class TargetRelabelException(Exception):
    pass

class LabelReuseException(Exception):
    pass

@@ -1,12 +1,31 @@
+import memory%0D%0A%0D%0A%0D%0A
 class Symbol
@@ -202,32 +202,77 @@
 dress, label):%0D%0A
+        address = memory.normalise(address)%0D%0A
         if addre
@@ -761,32 +761,77 @@
 elf, address):%0D%0A
+        address = memory.normalise(address)%0D%0A
         label = 
@@ -954,33 +954,340 @@
 def 
-get_label(self, address):
+add_generic_variable(self, address):%0D%0A        address = memory.normalise(address)%0D%0A        assert memory.RAM.contains(address)%0D%0A        label = %22var%7B:04%7D%22.format(self._generic_id)%0D%0A        self.add_label(address, label)%0D%0A        self._generic_id += 1%0D%0A%0D%0A    def get_label(self, address):%0D%0A        address = memory.normalise(address)
 %0D%0A  

Normalise addresses when dealing with symbols.