Trixter
Veteran Member
but it seems like Turbo C won't let you access the structure members...
I really find this hard to believe. What version of Turbo C are you using, and have you consulted the manual (try bitsavers or archive.org)?
If a function needs access to a ton of parameters, there's nothing wrong with what you're doing (passing a pointer to a structure). However, like Plasma suggested, if you're only passing 8 or less, you should pass them normally. They'll get copied onto the stack, then the stack frame will be set up using BP, and then the assembler routine will access them using [BP-xx] which is really fast and simple. Passing 8 variables is slower than passing one, but this is not a big deal unless you're calling the function thousands of times a second, which you won't be in this case. (And if you're going to call anything thousands of times a second, you should be doing it inline anyway, or optimizing the process)