Searching \ for 'INCLUDE files' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=include+files
Search entire site for: 'INCLUDE files'.

Truncated match.
PICList Thread
'INCLUDE files'
1997\01\26@013436 by Ed Todd

picon face
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
example:
PROJECT
       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
       INCLUDE "..\S\SERIAL.ASM"
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.
 <spam_OUTedtoddTakeThisOuTspamsni.net>    Ed Todd

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...