core: implement function to move address either to backward or to forward