On Mon, Mar 01, 2004 at 09:47:35AM -0500, Richard Mulvey wrote: > Hi All: > > 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? It's the punch line to my Gorilla joke, which I won't retell here: "We've always done it that way." Here is a analogous story: http://home.att.net/~michael.wolfe/always.html > It seems more than a little odd to find extensive > web pages full of projects, in which the same code is simply duplicated > over and over in multiple copies of files, some of which are obviously > just earlier versions that never got updated. 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. Things change, slowly. It's the same issue I had when I wrote my 16F84 is obsolete page here: http://www.finitesite.com/d3jsys/16F628.html to qoute a portion... "However at this point there is a lot of inertia. With the widespread books, articles, and websites about the 16F84, the fact that Microchip has progressed in their product lines is somewhat obscured." Same issue with relocatable modules. > > Anyhow - is there some inherent advantage of absolute mode that > I'm missing? Nope. It's just that the weight of all the absolute code generated makes it hard to move. > 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. Agreed. However what happens is the points of the jokes above. You learn something one way because that's the way that it's done, then it becomes a hassle to move to another way of doing it. Humans are creatures of habit. Once habituated, it's hard to change. Olin had been the relocatable advocate around here. He has a whole system set up around relocatable modules. I'm sure someone can post a pointer, yes? This reminds me that Brad Parker and I will have to add a linker and a library format to NPCI for the reasons outlined above. But getting a stable interpreter and compiler going is top priority. You can get a NPCI overview from the languages page linked to the 16F628 page above. And yes, the interpreter is written in absolute mode. Habits die hard. BAJ -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu