Thanks for bringing me up-to-date on relocatable code. 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. > > The templates use a form for the interrupt vector, > > > > ORG 0x004 is replaced by > > > > INT_VECTOR CODE 0x000 > >Should be : > > > INT_VECTOR CODE 0x004 > > > followed by the isr. However, this bombs when I try to assemble it; > >Yes, since it has the same address as "RESET_VECTOR". Sorry, a typo. I did use INT_VECTOR CODE 0x004 followed by a simple ISR, just context saving, [code below] but the assembly error was: Error - section 'INT_VECTOR' can not fit the absolute section. Section 'INT_VECTOR' start=0x00000004, length=0x00000010 >The CODE is used anywhere where you wan't to start a new code segment. I hope you have the patience to tell me how that is used. Where would it be useful to have different CODE sections. >You have some general confusion. You need to ** READ THE MANUAL **. In >this case, that is the MPASM / MPLIB / MPLINK guide. Understand what all >the assembler directives do, and how they work with the linker. Thanks for the help. I'm not lazy and do look at the manuals first but this is rather new to me and is not my area of training [which is physics and astronomy] but I am interested and wish to replace chips like the BasicX with PICs in my robotics projects. I like the PIC simplicity, elegance, speed, and control. Please feel free to comment on the form of the code. How do I treat the portb equate, RES doesn't seem to work. If I follow the interrupt vector with a goto iserv and put the ISR down under Main Code, it assembles. list p=16F84 #include INT_DATA UDATA 0x0C portb equ 0x06 w_temp RES 1 ; variable used for context saving status_temp RES 1 ; variable used for context saving ;********************************************************************** RESET_VECTOR CODE 0x000 goto start INT_VECTOR CODE 0x004 movwf w_temp movf STATUS,w movwf status_temp ; isr code can go here or be located as a call subroutine elsewhere movf status_temp,w movwf STATUS ; swapf w_temp,f swapf w_temp,w retfie MAIN CODE start movlw 0x00 tris portb movlw 0x0f movwf portb circle goto circle END Thanks, John Piccirillo -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist