Code generators for saving/restoring values