On Thu, 2 Mar 2006, Wouter van Ooijen wrote: >>> If you disagree I'll rephrase: how do you do it in a portable way >>> (one source for PIC and an as-yet-undifined chip, but one that is >>> supported by the HLL)? > >> // setup (can include setup file) >> (snip the rest) > > I don't see how your code handles an as-yet-undifined chip, it does only > PIC and 8051. It can of course be extended for another specific chip, > but it can't handle a new chip without additions/changes. It does PIC 8051 and *POSIX*. That is plain C. Not only that but if the #ifdef setup is done right (as I try to) then the program can be compiled and run even on a mainframe (using only the C implementations). When you get an 'unsupported' chip then the POSIX implementation will necessarily run (subject to the compiler being compatible). After that, the implementation can be adapted and a more optimal code generated for that CPU. That will appear as another #ifdef section with assembly (or whatever) for that CPU. Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist