On Sat, 11 Jan 1997, John Payson wrote: > > I guess what spurred this question is the pointer definition above. For a > > lot of the smaller devices, how often are pointers actually used and what > > are the advantages? > > If a language permits arrays and either reference or in-out parameters, there > is IMHO little advantage to supporting pointers in many small microcontroller Strange, I would have said the opposite (well, more or less). In a very normal sort of embedded application I've got a half-dozen sensors that all need simimlar processing (identical but for address out of PIC pins for sampling and conversion, then most get further processing that's identical but for some parameters that are per-sensor). In my first hack I used macros as templates and expanded it all inline with arrays to hold the data, but I've since reverted to a slightly more complex version that greatly reduces code duplication by using common code and passing a pointer to the per-channel data structures (one for acquistion, one with variable parameters for post-process). Overall this has saved quite a bit of code space, enough to keep me from having to deal with crossing the 16C73's page boundary as more features were implemented beyond hte early versions. The data structures are still more or less arrays, but I don't think that is at all significant aside from during initialization, and it's not very important there. The parameter structures do not make a proper array, since one field is a varying-size list. Anyway, that's how my milage has been varying on this project.