def read_register(self, reg):
    if (reg in self.registers):
        return self.registers[reg]
    raise ValueError('reading register with no value')
def read_register(self, reg):
    if (reg in self.registers):
        return self.registers[reg]
    raise ValueError('reading register with no value')