Lookup table?

Discussion in '8bit Microcontrollers' started by Kahlua, Jan 20, 2008.

  1. Kahlua

    Kahlua Guest

    I am using a 89C450 mcu.
    I need to execute 1 of 100 subroutines depending on the value of the acc
    Sort of like a lookup table I think.
    Any ideas?
     
    Kahlua, Jan 20, 2008
    #1
    1. Advertisements

  2. Kahlua

    Kahlua Guest

    Thanks very much
    Works like a charm


    "TT_Man" <> wrote in message
    news:%oPkj.15134$g%...
    >
    > "Kahlua" <> wrote in message
    > news:lKOkj.4832$5h6.2790@trndny09...
    >>I am using a 89C450 mcu.
    >> I need to execute 1 of 100 subroutines depending on the value of the acc
    >> Sort of like a lookup table I think.
    >> Any ideas?
    >>
    >>

    > Use JMP @A+ DPTR
    >
    > Acc = jmp val
    > DPTR = table start
    >
    > entry:-
    > MOV DPTR,#TABLESTART
    > ADDA,A
    > ADDA,A (A*3)
    > JMP @ A+DPTR
    >
    >
    > Table start :
    >
    > ljmp routine 0 (3 BYTES PER JUMP)
    > ljmp routine1
    > .
    > .
    > .
    > . ljmp routine99
    >
     
    Kahlua, Jan 20, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quack

    table-top led's

    Quack, Jan 18, 2004, in forum: General Electronics
    Replies:
    0
    Views:
    537
    Quack
    Jan 18, 2004
  2. PBS

    Scoring sensor for Air-Hockey Table

    PBS, Jan 26, 2004, in forum: Electronic Basics
    Replies:
    1
    Views:
    3,925
    Ross Mac
    Jan 26, 2004
  3. colin

    need C code for simple ascii font lookup table

    colin, Nov 30, 2006, in forum: Electronic Design
    Replies:
    10
    Views:
    3,205
    colin
    Dec 1, 2006
  4. robb

    where to lookup replacement for GE C10682 752

    robb, Mar 6, 2007, in forum: Electronic Components
    Replies:
    3
    Views:
    625
  5. ssylee

    Digital Logic: Lookup Table

    ssylee, Oct 27, 2008, in forum: Electronic Basics
    Replies:
    0
    Views:
    1,549
    ssylee
    Oct 27, 2008
  6. Urchie
    Replies:
    4
    Views:
    9,316
  7. rob_croxford

    How to create a lookup table

    rob_croxford, Oct 19, 2010, in forum: Microcontrollers and Programming
    Replies:
    2
    Views:
    1,856
    rob_croxford
    Oct 20, 2010
  8. rickman

    Sine Lookup Table with Linear Interpolation

    rickman, Mar 16, 2013, in forum: Electronic Design
    Replies:
    93
    Views:
    2,102
    rickman
    Mar 27, 2013
Loading...