William Chops" Westfield" wrote: > I would think that absolute mode would have value in teaching and > understanding a microcontroller and assembler. "limited resources > that you must manage yourself in explicit detail." Have the linker > do all the work? You might as well have a "Data Division"... First, you don't always need to manage things yourself in explicit detail. In fact usually not, although it's important to be able to on occasion. Second, relocatable mode allows you the same control that absolute mode does when you want it. Take a absolute program and replace every ORG with a absolute CODE, and replace every CBLOCK used to define variable symbols with a absolute UDATA followed by RES for each symbol. Now you've got a relocatable mode program with exactly the same control as the absolute mode program except that: 1 - The linker will catch it when you accidentally force two variables to the same RAM address. 2 - The linker can tell you if a code module crosses a page boundary. If you really want it to cross a page boundary, you can set up the linker file to allow it. 3 - You can break the code into multiple seperately assembled modules, each with its own namespace for local symbols. 4 - If you port the code to another PIC, the tools will tell you if you are trying to put something in code or data memory where the new chip doesn't have program memory or general RAM. If you then continue on and embrace relocatable mode instead of fighting it you also get automatic allocation of modules to pages with a guarantee that code in no single module crosses a page boundary. Relocatable mode is a superset of absolute mode, with some nice things added so that you don't have to hard code addresses and other assumptions in the source like you have to in absolute mode. It lets you write better code with no downside. OK, you do have one additional file, the linker file. The latest Microchip linker files that come with MPLAB pretty much just work unless you're doing something unusual, so you only need to copy one of them or one of mine from my PIC development environment at http://www.embedinc.com/pic. It's really time to put absolute mode behind us. Way behind us. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist