> I am learning how to use the linker on MPLAB 6.10. I'm using MPLAB version 5, which my answers below apply to. > So far so good, but something I realy don't like is the way you have > declair addresses and registers with GLOBAL and EXTERN, etc. Isn't there > a better way of doing it? Seems like a lot of extra work and when I am > going to do a large program I think it is realy going to irritate me. GLOBAL and EXTERN are your friends, and don't work any differently in MPLAB than they do in most other assembler/linker combinations. It is a good thing that symbols don't go outside a module unless you explicitly define them to. Otherwise it would be a difficult task to keep symbol names unique accross many modules. Wanting to GLOBAL and EXTERN too many variables is usually an indication of bad design or modularization choices. Sit back and think about your whole project and identify subsystems that might require some internal state but have only a limited interface to the rest of the system. Put each subsystem in its own module. You'll also then appreciate that each module gets its own namespace for local symbols. I've done dozens of professional PIC projects and use relocatable mode exclusively. You can see the details of my general project framework at http://www.embedinc.com/pic. See the HOS_UART.ASPIC module at http://www.embedinc.com/pic/hos.htm for a good example of modularization. This is an interrupt driven UART handler with software receive and transmit FIFOs. The state defined in this module is the two FIFOs and two scratch registers for use by the interrupt routines. Note that all of this state is local, meaning it can't be accessed directly from outside the module, and none of it is therefore defined GLOBAL. The only global symbols exported by this module are the UART_PUT and UART_GET public subroutines, and the interrupt routine entry points. This module does use two flag bits that are global. These are defined in the master include file due to my method of allocating global flag bits with the /FLAG preprocessor directive (native MPASM doesn't support flag or bit variables directly), but can be thought of as state exported by this module. > The help file refers to a .MAP file, where you can see your memory > usage, etc. I can't find any. Do I have to be set in on a command line? > If so where? Yes, there is a command line option to enable/disable the map file. I'm at home now and don't have the MPASM manual here, so you'll have to look up the details yourself. I always run MPLINK thru my LINKPIC wrapper, which always causes a map file to be written. I archive the map file along with other files for each released version of a project. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.