On Thu, Jul 13, 2000 at 09:33:23AM +0100, Geoff Wootton wrote: > Thanks for the pointer to your web page. Regarding the section > on CALL/RETLW usage I was wondering if anyone has an example > of a vector table. Yeah, goes sort of like this ... org 0x0 goto main ; vector table alpha goto alpha_real beta goto beta_real delta goto delta_real main call alpha [code] call beta [etc] goto main alpha_real [lots of code] retlw beta_real [lots of code] retlw delta_real [lots of code] retlw The point being that this allows the *_real entry points to exist anywhere within the bank memory. You CALL the vector table entry point, and it does a GOTO to the real entry point. It works because GOTO has the extra bit for the address that CALL does not. If your code extended beyond 0x200, you could place a different vector table at the low end of the second page ... org 0x200 ; vector table alpha bank0 goto alpha_real beta bank0 goto beta_real However with this trick your code would have to take care to restore PA0 before it tries the next CALL or GOTO within 0x200 to 0x3fe ... high call alpha bank1 goto high -- James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements