Rich wrote... > I'm one of the relative newbies to the PIC ( and microcontrollers >in general ), here, though I come from 15 years in applications >development in C/C++/Java etc. One thing I've noticed is that the >vast majority of asm code I find relating to the PIC is all written >in absolute mode, and not relocatable mode. Is there any particular >reason for that? I think there are several reasons: 1) A fair percentage of the people here who are new to PICs are very likely also relatively new to programming (or at least assembly language programming), as well. 2) To someone who hasn't worked with relocatable code before, the advantages of doing so may not be obvious. 3) Microchip's documentation for MPLINK is probably just fine for the experienced user who not only used a linker before, but understands WHY you'd want to use one in the first place; it seems to cover the basic mechanics of using MPLINK adequately. 4) But for anyone (like me, up to a year or so ago) who doesn't have the slightest clue about what the linker does, and the advantages you gain from using it, Microchip's MPLINK docs are simply atrocious. They're worse than useless: they're a powerful repellant against anyone wanting to learn MPLINK. 5) There don't seem to be any really good tutorials on using MPLINK, aimed at new users. (I'm writing one, but it's going to be a few more weeks before it's ready.) These factors conspire to make relocatable code somewhat rare here, at least among the PIC hobby community. [...] >In one of the books >I'm reading, the author explicitly states that he never uses relocatable >mode, because the linker is too slow, etc. Slow? Maybe the author's using an old, slow computer. Mine runs plenty fast. > Anyhow - is there some inherent advantage of absolute mode that >I'm missing? Nope. It sucks bad gas. >It seems like just having a library of routines available >that can be easily source controlled and made availible to multiple >projects makes far more sense than the endless use of include files. That, plus the ability to encapsulate code with the data it uses, the ability to control the scope of symbols, and memory allocation which is at least semi-automatic, are all good reasons to use MPLINK. It makes life WAY easier. Dave D. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu