Skip to main content
Visitor II
July 9, 2004
Question

ST72264 lookup table

  • July 9, 2004
  • 3 replies
  • 800 views
Posted on July 09, 2004 at 10:01

ST72264 lookup table

    This topic has been closed for replies.

    3 replies

    feedbackAuthor
    Visitor II
    June 24, 2004
    Posted on June 24, 2004 at 04:40

    How do I set up lookup table in ST72264 and access it?

    Any tips is appreciated!

    Cheers!
    Visitor II
    June 24, 2004
    Posted on June 24, 2004 at 12:27

    You can use direct Indexed addressing mode to access the lookup table.

    Visitor II
    July 9, 2004
    Posted on July 09, 2004 at 10:01

    In assembly...

    segment 'rom'

    .table DC.B $10, $20, $40, $80

    .reset

    ld X, #0

    ld A, (table,X) ; A now contains $10

    inc X

    ld A, (table,X) ; A now contains $20

    In C (Cosmic):

    const unsigned char table[] = {

    1,2,3,4,5,6,7,8,9

    };

    void main()

    {

    unsigned char a;

    a = table[0]; // a contains 1

    }