1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dear Visitor, we are presently having a membership drive and as a result EVERY new member that registers an account and makes THREE meaningful posts will have a mighty $10,000$ forum credits added to their wallets ... GET YOURS NOW!
    Dismiss Notice
  3. IMSpot.Org is under new management and we look forward to bringing you a range of exciting enhancements in coming days.
    Dismiss Notice
  4. Dear Visitors, why not register an account now and say hello ... we really would love to hear from you?
    Dismiss Notice
  5. Welcome to IMSpot.Org an internet marketing forum and very friendly place for discussion, learning and help in your online endeavours ... please consider joining our internet marketing community and sharing your knowledge with our members.
    Dismiss Notice

What is a far pointer? Where we use it?

Discussion in 'Design & Development' started by beingchinmay, Jan 2, 2017.

  1. beingchinmay

    beingchinmay An Active Forum Member

    Joined:
    Jun 24, 2015
    Messages:
    28
    Likes Received:
    1
    A far pointer is a four byte pointer that used to access the main memory of the system. It can access the code and data segment, just by modifying the offset you can modify the address.
     
    PassingThrough likes this.
  2. PassingThrough

    PassingThrough The IMSpot Administrator
    Staff Member

    Joined:
    Aug 8, 2011
    Messages:
    670
    Likes Received:
    75
    That's my understanding also Beingchinmay,


    Every program has its own data and code segments which are allocated by the compiler at run time.

    The normal or near pointer can address locations which can be found in its own data segment.

    The far pointer is used to address locations which are outside this data segment, for example finding the size of RAM at location 0x417.

    To do that and thereby determine the RAM size we would use the following code snippet.

    char far *siz=(char far*)0x417;
    printf("The Ram Size IS :%d",*siz);


    You have bought back some wonderful memories of my DOS days, and for that I thank you. :banana
     
  3. PassingThrough

    PassingThrough The IMSpot Administrator
    Staff Member

    Joined:
    Aug 8, 2011
    Messages:
    670
    Likes Received:
    75
    You are a coder, yes beingchinmay?
     
Loading...
Live Thread addon by sonnb

Share This Page