def check_addr(self, addr):
    if (addr < 0):
        raise Exception(f'Addr {addr}, cannot be negative')
    if (addr >= len(self.memory)):
        self.expand_memory(addr)
    return addr
def check_addr(self, addr):
    if (addr < 0):
        raise Exception(f'Addr {addr}, cannot be negative')
    if (addr >= len(self.memory)):
        self.expand_memory(addr)
    return addr