At 12:28 11/04/2001 +0000, Ian Chapman wrote: >I would be interested in any thoughts on how best to apply a "modular" >programming discipline to 14-bit PIC applications in which the overhead >presented by interrupt handling is an important consideration. > >1. NON-MODULAR APPROACH >[...] >2. MODULAR APPROACH USING MPLINK >[...] >3. MODULAR APPROACH USING MACROS >[...] >; NOTE - There are at least two sub-approaches here: >; >; (a) Add EXTERN definitions for variables and subroutines which >; are then linked in from a separate module source file as in >; approach 2. >; >; Advantage: Enables MPLINK and MPLIB to be used for >; non-interrupt code >; Disadvantage: Splits module source code across two >; files (include and separate source file) >; >; (a) Define similar macro definitions for variables and >; subroutines which are invoked later on in main source file. >; Advantage: Keeps module source code together >; Disadvantage: Messy and still requires tracking of >; macro invocations in main source file FWIW (and I don't know how much it helps here) I often use something like the 3rd option, but with C. It is not completely modular, because variables that get used in the interrupt macro have to be global, but with some programs this technique helps keeping things that belong together in one place. That is, in two places: the header file (.h, in assembler this is typically an include file) and the actual code file (.c). But for a linked C program, this is not actually a disadvantage, because I have the two files anyway (to keep declarations consistent). ge -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics