Hi Steve,
You can pretty much do the same jump table as you might got used to it on
the 16F using math operation on the PCLATU:PCLATH:PCL, except that:
1. On a 18F the addressing of he program memory is in bytes, not in words
-- and as 1 word is 16 bit on a 18F you need to count 2 bytes per
instruction
2. However, there are 2 word sized instructions such as GOTO, CALL, MOVFF
etc (use BRA and RCALL instead if you can)
3. You may also want to study the CALLW instruction which is a good thing
in many times
Tamas
On 15 January 2012 13:19, M.L. <.....mKILLspam
@spam@lkeng.net> wrote:
{Quote hidden}> On Fri, Jan 13, 2012 at 2:43 PM, Steve Willoughby <
steve
KILLspamalchemy.com>
> wrote:
> > I'm trying to implement my first PIC18 project (after spending all my
> > PIC work so far in the PIC16 family). So far it's a big improvement but
> > I'm having a little trouble figuring out the best way to do jump tables
> > in this architecture.
> >
> > I have three questions around this which I haven't seen anything
> > specific to the PIC18 family in my searching so far:
>
> Steve,
> One thing I would recommend is using the MPLAB simulator to step
> through your code. This should work very well for illustrating what
> the PIC is doing internally.
>
> --
> Martin K.
>
>