On Sat, 21 Feb 2004 23:55:32 GMT, Dave Dilatush wrote: > >I found learning to use the linker rather non-trivial, but >finally got the hang of it (at least for my limited needs). I >put up a small example of how to use it, at: > >http://mywebpages.comcast.net/dilatush/lnkdemo2.zip > Excellent demo file, Dave. I think you've illustrated just about everything a first-time user of relocatable code needs to see in a very comprehensible form. I knew somebody had created such a file; I just couldn't remember who it was. :=) The only thing that isn't obvious is why you would use 'lgoto' for the jump back to the label 'begin' in the main file. (Obviously, since you've just returned from an external routine, you need to get PCLATH pointed back to the current page but a beginner wouldn't necessarily realize that.) Using lgoto there could confuse a beginner into thinking that call's and goto's always need to be done using lcall and lgoto. You might want to consider putting a 'pagesel $+1' line after the subroutine calls. Adding that line would allow the jump back to 'begin' to be coded with a regular goto rather than the lgoto. Regards, Bob -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads