Multiple return values ---------------------- 1. use more than one register obvious solution, but the number of registers is limited. 2. pass a pointer (as an input parameter), and put the output there works, and I think this is how C compilers typically handle large return values. 3. reserve extra data before the input parameters, and put the output there. should work, but why isn't it used? [wrong*] it's probably better to place the return parameters after the input parameters. that way both input and return parameters can have a dynamic size. *this is not going to work with tail recursion, and dynamically sized return parameters would mean that the return address wouuld have to be moved. 4. overwrite the input parameters, and let the caller shrink the stack when it no longer needs them. can work, but the input and output parameters can't be used at the same time. ----------------- things that won't work: 1. return data above the stack (immediately after/above the return value). data above the stack pointer can get overwritten in some environments. for example, registers may be stored on the stack when a process is preempted. 2. returning data anywhere other than the stack/registers. it can of course work, but then we need to deal with thread safety.