Searching \ for 'Code Redirection' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=code+redirection
Search entire site for: 'Code Redirection'.

Truncated match.
PICList Thread
'Code Redirection'
1999\02\10@195216 by Graeme Smith

flavicon
face
Hi...

I was working on a sort of sequencer based on a 16c5x unit...

(Intentionally underimplimenting an RTOS in order to learn the limits
of its design) and I came to the point where I want to impliment a
jump table, only to find, that I don't really know how to impliment it
on this architecture...

I can figure out how to get the vectors back, but variable gotos confuse
me. What I want to do, is index the jump table, and get a jump value, that
I can then use to "goto to". It doesn't seem that indirect and fsra are
the right approach, and I am not certain that I want to try ADDING W
to the PCR register, but I am also not sure I have a choice...

Considering that somewhere on this list there are people that are working
at three layers of indirection, it seems that it must be possible...

How Is it usually Done? Am I making a mountain out of a molehill? or
is this one of the unwritten tricks to learning PIC programming?

                               GREY

GRAEME SMITH                         email: spam_OUTgrysmithTakeThisOuTspamfreenet.edmonton.ab.ca
YMCA Edmonton

Address has changed with little warning!
(I moved across the hall! :) )

Email will remain constant... at least for now.

1999\02\10@202737 by Regulus Berdin

picon face
Graeme Smith wrote:
> I can figure out how to get the vectors back, but variable gotos confuse
> me. What I want to do, is index the jump table, and get a jump value, that
> I can then use to "goto to". It doesn't seem that indirect and fsra are
> the right approach, and I am not certain that I want to try ADDING W
> to the PCR register, but I am also not sure I have a choice...

Can be done by:

       andlw   B'00000111'     ;mask for 8 jumps only
       addwf   PCL,f
       goto    branch0
       goto    branch1
       goto    branch2
       goto    branch3
       goto    branch4
       goto    branch5
       goto    branch6
       goto    branch7

regards,
Reggie

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...