Bob stated: > > I know you go on and on about using the linker. However, I have recently > > done one job on an '876 that just plain would not have worked using a > > linker. Olin replied: > I don't believe that. How familiar are you with the linker, Bob? There > seem to be a lot of myths out there about relocatable mode that just > aren't true. I suspect that you haven't used the linker much (at all?) > and therefore aren't aware of all the things you can do in relocatable > mode. One way to think of it is that relocatable mode is a superset of > absolute mode. If you want to specify every last address, you can. > However, for the vast majority of cases when you don't care, you can let > the linker do it's allocation magic. In either case you still get nice > things like private name spaces for each module. Ok, Let me rephrase. Yes, it would have worked using the linker, but it would have involved a lot of fussing with the .LKR file. Sometimes several code pieces were carefully packed into single 256-word chunks (so that I could run state machines by simply copying state values toPCL). Other chunks just had to fit within the same 2K page as the state machines they supported. In some cases I had to ensure that several distinct 256-word chunks, each containing the code for one or more state machines all were within the same 2K page. I was able to ensure that everything fit where it was supposed to by using appropriate IF checks in the asm code. And, btw, not using the linker doesn't mean you can't modularize (although you lose scoping of variables). > I bet that you only needed a small subset of your > code at known addresses, and could have let the linker place the rest > wherever is wanted to. Actually, most of the code had to be carefully laid out. Again, not to say the linker isn't wonderful (it is), but it is not a panacea, and is not _always_ the right answer. Bob Ammerman RAm Systems -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads