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 code segment

Hi there,
I had a font bitmap table which is 1088 bytes. The Ram in chip is not big enough. So I am thinking to put it in code segment. My questions are
How do I do it in C and
If the lut were in code segment, how can i access it?
I am using 89c51rd and c51 compiler.
Thanks

Parents
  • Declare your font bitmap as living in the "code" memory space, e.g.

    const U8 code bitmap[] = { 1, 2, 3, 4 };
    

    The compiler will take care of accessing the variable via the MOVC instruction to access the code memory space through the DPTR instead of MOVX for external data.

Reply
  • Declare your font bitmap as living in the "code" memory space, e.g.

    const U8 code bitmap[] = { 1, 2, 3, 4 };
    

    The compiler will take care of accessing the variable via the MOVC instruction to access the code memory space through the DPTR instead of MOVX for external data.

Children