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

Making a FAR pointer

Hi all,

I have the following:
u8_t far * ptr;
u8_t buf[10];

and on positions 1,2,3 (buf) I have the FAR address (3 bytes) that I want to use:

*ptr = 1; // for instance;

How can I give ptr the value of the 3 bytes on the array?
Something like : ptr = MAKE_FAR_PTR(&buf[1]);

This is for Dallas contiguous mode.



thanks,
joao

Parents Reply Children
  • Thanks a lot.

    Now, to try, I have something like:

    long l;
    l=0x012345
    FVAR (u8_t, l) = 0x01;
    l++;
    if (FVAR (u8_t, (l-1))!=0x01)
                        {
                            TRACE(("read!=write!\n"));
                            return 1;
                        }
    

    But running on dscope I get 2 errors - no read permission on 0x012345 and also no write permission.

    I have the following for data:
    XDATA (X:0x2000-X:0xFFFF), HDATA (X:0x2000-X:0x401FFF)

    Because of this I can not fully test.
    Any help on this?

    thanks,

  • Ok now it is working:)

    thanks again for the FVAR link.

    I have changed the memory map on dscope although I do not know why it does not starts with the correct configuration!

  • I have changed the memory map on dscope although I do not know why it does not starts with the correct configuration!

    The debugger gets the memory map from the data and code segments stored in the absolute object module (that it loads). IF you access anything outside that space, the debugger assumes it to be an error.

    The FVAR macro accesses a memory address that is not occupied by data or code in your program. If this is how you want to access memory, all you need to do is to tell the debugger since that information is not included in the OMF file.

    Jon