|INCLUDE is very powerful, especially with multiple platforms and/or
targets, similar to a PC app being written for DOS, UNIX, Windows.
You can create a directory structure for you project. Take the following
S Holds files common to more than one target
MASTER Holds files for the master unit
SLAVE Holds files for the slave unit
S could hold a file with all defines, registers, common storage. Another
file with macros. Let's say your project has serial I/O that is common to
both units, put that code in SERIAL.ASM in the S directory.
In your main ASM file in the MASTER directory, you would put
in the appropriate place to include the serial I/O. Do the same thing in
the SLAVE unit main ASM file. Any bug you fix in SERIAL.ASM is
automatically applied to both units.
In my view, this is the real reason for using INCLUDE: you can write
important things once and reuse them: PIC ASM is like any other language,
you want to reuse code and avoid duplication. The files that come with the
compiler that define the chip registers are just one thing you want to
avoid writing more than once.
When you get more fancy, you start using IF/ELSE/ENDIF to do or include
specific things for a platform or target.
In some of our C language projects, we use a S, PIC and WINDOWS
directories: prototype under Windows and then port to PIC. The core logic
goes in S, the hardware interface stuff goes in WINDOWS or PIC directories.
Enough for now.
<sni.net> Ed Todd edtodd
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...