John Piccirillo wrote: > I do have the assembler/linker/librarian manual and have > looked at it but as is usually the case this is a reference > and not a tutorial and some of the discussion is only > comprehensible if one is already in the know. Not really. Look again, it's all in there. When I first started with PICs, I sat down and read that manual and the data sheet for the first PIC I tried to use, and was able to get things up and running from there. The only part that is missing is generic knowledge from Computing 101. You do need to understand at a high level what an assembler, librarian, and linker do and why you'd want to use each of them. > Error - section 'INT_VECTOR' can not fit the absolute section. > Section 'INT_VECTOR' start=0x00000004, length=0x00000010 That's due to a Microchip stupidity in the default linker files. For some idiotic reason, they define a section starting at 4 of some small arbitrary length. Quite often your ISR will need more space than that. The right way to do this is to make all of page 0 one section. Set the code at the reset and interrupt vectors to absolute addresses 0 and 4 respectively, then let the linker place all other code around it. I've got a bunch of tested linker files in my PIC development environment at http://www.embedinc.com/pic. These will save you the trouble of modifying the Microchip ones. > I hope you have the patience to tell me how that is used. Where would > it be useful to have different CODE sections. Code sections, or sections in general work pretty much the same way as they do an any other machine. PIC code sections are not really different than code sections on Windows. It sounds like your problem is not so much with the Microchip assembler/linker as a confusion about assemblers/linkers in general. I don't want to repeat Computing 101 here, but briefly, "sections" are those units in an address space that are placed independently by the linker. > How do I treat > the portb equate, RES doesn't seem to work. PORTB and all SFRs and bit names within them are defined in the standard Microchip include files. You shouldn't try to define them yourself. > If I follow the interrupt > vector with a goto iserv and put the ISR down under Main Code, it > assembles. Yeah, but that's a bad idea. Some code will end up at location 4, so it might as well be the ISR. At the least this saves one instruction and two cycles every interrupt. More importantly, putting a GOTO at the interrupt vector is a bug in multi-page machines since the value in PCLATH is not guaranteed. If you want to see an interrupt routine template, take a look at my QQQ_INTR.ASPIC module. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist