Searching \ for 'Help: Jump table over FF bytes long' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=table
Search entire site for: 'Jump table over FF bytes long'.

Truncated match.
PICList Thread
'Help: Jump table over FF bytes long'
1997\04\30@081825 by David Nicholls

flavicon
face
Could anyone tell me an easy way to convert the usual jump table code so
that it works for tables over FF hex
I've just crossed that mark and I have a project demo at 2 O Clock
( 1 hr from now )

eg
       addwf   PCL,f
       goto    Main
       goto    start1
       goto    start2
??

                               Please..
                                       David.

1997\04\30@090020 by Clyde Smith-Stubbs

flavicon
face
Thus spake David Nicholls (spam_OUT9313303TakeThisOuTspamUL.IE):

> Could anyone tell me an easy way to convert the usual jump table code so
> that it works for tables over FF hex


PC      equ     2
PCLATH  equ     0Ah
STATUS  equ     3
C       equ     0
Z       equ     2

;This code is called with a 16 bit index in code_ptr

string_table
string_indir
       movf    code_ptr+1,w            ;get high byte
       addlw   (table_label)>>8
       movwf   PCLATH
       movf    code_ptr,w              ;get low byte
       addlw   table_label&0ffh
       btfsc   STATUS,C
       incf    PCLATH
       movwf   PC
table_label
       ;table starts here

       goto    somewhere
       retlw   1
       goto    etc.


--
Clyde Smith-Stubbs    | HI-TECH Software,       | Voice: +61 7 3354 2411
.....clydeKILLspamspam@spam@htsoft.com      | P.O. Box 103, Alderley, | Fax:   +61 7 3354 2422
http://www.htsoft.com | QLD, 4051, AUSTRALIA.   |
---------------------------------------------------------------------------
Download a FREE beta version of our new ANSI C compiler for the PIC
microcontroller! Point your WWW browser at http://www.htsoft.com/

1997\04\30@104347 by Dirk Van den Berge

flavicon
face
At 1:07 PM 4/30/97, David Nicholls wrote:
>Could anyone tell me an easy way to convert the usual jump table code so
>that it works for tables over FF hex
>I've just crossed that mark and I have a project demo at 2 O Clock
>( 1 hr from now )
>
>eg
>        addwf   PCL,f
>        goto    Main
>        goto    start1
>        goto    start2
>??
>
>                                Please..
>                                        David.


Why not use several FF jumptables, and one smaller jumptable using the
higher bits of the selector to take you the right FF jumptable?

Dirk Van den Berge
dvdbspamKILLspamvub.vub.ac.be
AZ VUB Radiotherapy Dep't
Laarbeeklaan 101
B-1090 Brussels
Belgium
Fax: ++32-2-477 62 12
Tel: ++32-2-477 60 41

1997\04\30@121340 by David Nicholls

flavicon
face
Thanks a million to everyone who helped me through this and the other
problems I have had since joining this list..
I have just finished my Project and It was quite sucessful.
       I could never have done it without the help of the PIC list and
its subscribers..


                                       David.





On Wed, 30 Apr 1997, Dirk Van den Berge wrote:

{Quote hidden}

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