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

Invalid mspace

Hello,

I had this appear when I tried to compile my code in C.
WARNING C196: MSPACE PROBABLY INVALID

I do know that this occurs when we try to convert a constant to a pointer constant and hence yielding an invalid memory space. An example char *p = 0x91234.

However, I was trying to store a pointer memptr into memory space 0x463 and assigning the value of 0x464 into the memptr. The code is as follows.

 void *memptr = (void *) 0x463;
 memptr = 0x464;

Please please help. Thank you.

Parents
  • ASSEMBLY LISTING of your code above:

    ; SOURCE LINE # 1
    0000 7B00 MOV R3,#00H
    0002 7A04 MOV R2,#04H
    0004 7963 MOV R1,#063H
    0006 8B00 R MOV memptr,R3
    0008 8A00 R MOV memptr+01H,R2
    000A 8900 R MOV memptr+02H,R1

    ; SOURCE LINE # 2
    000C 7B00 MOV R3,#00H
    000E 7A04 MOV R2,#04H
    0010 7964 MOV R1,#064H
    0012 8B00 R MOV memptr,R3
    0014 8A00 R MOV memptr+01H,R2
    0016 8900 R MOV memptr+02H,R1

    Is that you want?
    ______________________________________
    void * xdata memptr _at_ 0x463;
    memptr = 0x464;

Reply
  • ASSEMBLY LISTING of your code above:

    ; SOURCE LINE # 1
    0000 7B00 MOV R3,#00H
    0002 7A04 MOV R2,#04H
    0004 7963 MOV R1,#063H
    0006 8B00 R MOV memptr,R3
    0008 8A00 R MOV memptr+01H,R2
    000A 8900 R MOV memptr+02H,R1

    ; SOURCE LINE # 2
    000C 7B00 MOV R3,#00H
    000E 7A04 MOV R2,#04H
    0010 7964 MOV R1,#064H
    0012 8B00 R MOV memptr,R3
    0014 8A00 R MOV memptr+01H,R2
    0016 8900 R MOV memptr+02H,R1

    Is that you want?
    ______________________________________
    void * xdata memptr _at_ 0x463;
    memptr = 0x464;

Children
No data