This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting multiple return values from a function in registers

Is it possible to get multiple return values from a function in a different way than in fixed memory? I often need to get more return values than 1 from a function, for example 2 integers (16bit) and 1 byte, or something similar. In assembly, the easiest way to do that is to pass them through registers. But if the calling function, or both calling and called, are written in C, there is a problem that I can't reach to the registers. So I must pass them in global variables (useless ehausting of memory) or define a structure. But the structure is passed through fixed memory, too, and it is accessed with a pointer, what is too slow. I have tried several tricks, but I have not succeeded.

So I have these questions:
Is there any "standard" way to pass multiple return values in registers IN A C FUNCTION?
or
Is it possible to easily reach registers in C?
or
Is it possible to acces local variables defined in a C function from an inline assembly?


Thanks a lot. If it isn't possible, I will have to use global variables, but this would be a better and faster way.
Wormik

0