I have bunch of C and assembly files. C module makes call to routine in assembly and vice versa. But assembly language platform can change from one processor to another but we would like to keep C module unchanged.

This is design issue and system is real time so we need very memory efficient and less code consuming technique.

Option which I think of
1. Declare as global structure, first parameters will be pointer to function, second byte is length of parameters and type of parameters. Third, fourth and fifth words may contain byte, word or pointer.

Before calling the assembly function, fill the structure with this data and call the common gate routine. The common gate routine will fill the register specific to processor and invoke the assembly routine. Once assembly routine returns, fill the respective retrn value in register specic to processor and return back to C routine.

I wanted to know your inputs.

Thanks


l interface routine and restrict the number of parameters to