Byron Jeff wrote 2012-11-12 13:25: > On Mon, Nov 12, 2012 at 06:02:32PM +1100, David Meiklejohn wrote: >> Jan-Erik Soderholm wrote: >>> >>> But yes, use relocatable code and all that ORG'ing of different pieces >>> of code together goes away. The CODE directives will let the linker >>> sort it out. >> >> If you're not familiar with relocatable code, see my PIC assembly tutori= als >> (http://www.gooligum.com.au/tutorials.html), in particular "Writing Modu= lar >> Code": http://www.gooligum.com.au/tutorials/midrange/PIC_Mid_A_2.pdf. T= he >> approach suggested in that lesson is not to #include the file containing >> your subroutine, but to add the source file to your project tree. When = you >> build your project, only the parts of it which have changed will be >> re-assembled (not true if you #include), and the linker pulls it all >> together. Overall it's a cleaner approach that will scale as your proje= cts >> grow. >> >> But in any case, use CODE, not ORG! >> >> Cheers, >> David Meiklejohn >> www.gooligum.com.au > > Thanks for the pointer David. I'm trying to give the MPLABX simulator a > serious test and quickly came to the realization that absolute assembly > with includes simply isn't going to cut it. Your tutorial is as concise a > summary I've seen for generating relocatable code. > > Thanks again. > > BAJ > Some years ago I wrote a page showing the main differences between abs and relloc mode. Sorry, they are in swedish but the code as such is in MPASM which we all talk, right? :-) http://www.jescab.se/abs_reloc.html http://www.jescab.se/Relocmode.html Davids PDF i s abit more complete... Jan-Erik. >> >> >> >> >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .