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

Wrong mapping with C251 v2 compiler

Hi,

I am trying to recompile a project with C251 v2.This project was originaly compiled with C251 v1.

In one of my C files I use a string table declared like this :

char code *ErrorMess[]={"error1",
                        "error2",
                        "error3"};

With C251 v1 compiler, this constant was accurately mapped in CODE area, but with C251 v2, it is mapped in XDATA or EDATA area according the selected memory model.

What am I doing wrong ?

Parents
  • Yes, you can put the pointers in any memory space, such as:

    const char far  * code ErrorMess[]={"error1",
                            "error2",
                            "error3"};
    
    

    The addition of the "code" between the asterisk and the ErrorMess, tells the compiler that the pointers are to be stored in code space. When you look at the listing, you will see that the messages themselves are in const, but the pointers are in code. Hope you can use this.

Reply
  • Yes, you can put the pointers in any memory space, such as:

    const char far  * code ErrorMess[]={"error1",
                            "error2",
                            "error3"};
    
    

    The addition of the "code" between the asterisk and the ErrorMess, tells the compiler that the pointers are to be stored in code space. When you look at the listing, you will see that the messages themselves are in const, but the pointers are in code. Hope you can use this.

Children