sets retrn and the scratchpad to their proper values
restore(&retrn,&n,&i,&a,&f,&s);