Hi Stew,
This piece of code solved a lot of strange problems when I first started, it was one of the very few occasions that I resorted to searching the Web for a solution. Place it at the very start of your code. The memory of the 684 is only over one "page", so it is not a problem, but with larger PICs the memory may split over several pages and when you leave one page, due to an interrupt, you have to make a note of where you have come from so you can return after servicing the interrupt. See Section 2.0 of the Data Sheet.
Notice the use of "H" to define the following number as an Hexadecimal address. I tend to enter the Instructions e.g. ORG, GOTO etc, in upper case because they don't get confused with the comments after the semi-colon which are in lower case - that's just my style.
ORG H'0000' ;Reset vector address. This is where the PIC starts after a physical Reset, i.e. pin 4 has been decked to Ground. See Data Sheet 12.3d.
GOTO RESET ;goto RESET routine when boot. The RESET routine is the main body of the code after the Interrupt Service Routine.
ORG H'0004' ; Interrupt vector address. All interrupts arrive at this physical address H'0004'
NOP ; No operation.
; BEWARE!!! you must avoid the "GOTO INTERRUPT" or "GOTO ISR" statement at the interrupt vector as this inherits the
; page bits from the page that's interrupted! Just put a NOP at the interrupt vector
; and drop through to an interrupt routine in Page 0 at address physical address h'0005'.
; From:
http://www.piclist.org/techref/microchip/pages.htm Place your Interrupt Service Routine (ISR) from this location onwards and before the RESET routine.
; **********************************
; ** RESET : main boot routine **
; **********************************
RESET Your code starts here
What a lot to absorb!
Ian.