6.2.1 Returning Multiple-Values

If the current frame can accept multiple values and a values marker is in register A0 indicating N values on top of the stack, it is necessary to copy the N return values down to the top of the control stack after the current frame is popped off. Thus returning multiple values is similar to the above, but a block transfer is necessary to move the returned values down to the correct location on the control stack.

In tail recursive situations, such as in the last form of a PROGN, one function, FOO, may want to call another function, BAR, and return “whatever BAR returns.” Call-Multiple is used in this case. If BAR returns multiple values, they will all be passed to FOO. If FOO’s caller wants multiple values, the values will be returned. If not, FOO’s Return instruction will see that there are multiple values on the stack, but that multiple values will not be accepted by FOO’s caller. So Return will return only the first value.