This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Lookup table in C

To make a lookup table in c,I've tried like this

static code unsigned char T[]={0X01,0X02,0X03};
.But is it possible to prepare one as we do in assembly.
org 3000h
db 01h,02h,03h
i.e assigning some address to the variable T in the example given above.

Thanks,
Lina

Parents
  • "i.e assigning some address to the variable"

    No, it isn't.
    You can fix the address (see the _at_ keyword in the Manual), or you can have initialisation - but not both!

    If you really need to fix the location of the table, you must either do it in assembler, or use Linker controls.
    It's beed discussed ad nauseam - just try a search for "_at_"

Reply
  • "i.e assigning some address to the variable"

    No, it isn't.
    You can fix the address (see the _at_ keyword in the Manual), or you can have initialisation - but not both!

    If you really need to fix the location of the table, you must either do it in assembler, or use Linker controls.
    It's beed discussed ad nauseam - just try a search for "_at_"

Children
No data