The program keeps data (U) on the stack, and the stack may be disturbed due to user interaction while the first result is displayed. That's why I suggest removing the R/S command. This way both results, V and M, are returned at the same time in X and Y. Which makes the program safe to use.

Note: the program expects the object distance U as user input. Usually distance scales on lenses are calibrated to the sum of object and image distance (U+V) which means that, especially for larger magnifications, the results will differ.