goto is not a good idea as somewhere in the main you could have the pagesel set to another page than the isr. Tam=E1s On 4/6/10, ivp wrote: >> First problem: You have code at 0x04 that doesn't belong in the >> interrupt routine; it looks more like stuff that should be at "start"; > > Joe, > > Yes. At the bottom of memory are 2 vectors > > As absolute addresses you'd have something like > > org 0x00 ;reset vector > goto start > > org 0x04 ;interrupt vector > goto isr > > See Figure 2.1 in the datasheet > > Now, you can have the ISR before the main program in memory, after > the main program or within it > > For example have the ISR right at the bottom of memory, as some people > prefer. Then you'd have the main code following it, eg > > org 0x00 > > isr code > > org 0x100 > > main code > > Similarly the ISR can go after the main code, eg > > org 0x00 > > main code > > org 0x1000 > > isr code > > The ISR code can be embedded within the main code > > org 0x00 > goto start > > org 0x04 > goto isr > > org > > and isr is a subroutine in the main code that exits with a retfie rather > than a return > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = Sent from my mobile device int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist