What does "far" in BYTE far *Temp; mean?

Status
Not open for further replies.

SphinX

Advanced Member level 3
Joined
Jan 25, 2002
Messages
822
Helped
58
Reputation
116
Reaction score
29
Trophy points
1,308
Location
EGYPT
Activity points
7,045
Salam,

Code:
         BYTE far *Temp;
         Temp  = (BYTE far *)0xA0005555; /* set up address to be A000:5555h    */
         *Temp = 0xAA;                            /* write data 0xAA to the address     */

Please what does "far" mean here ?


Thanks
 

Re: BYTE far *Temp;

Far, means that the pointer is double word address, insted of word. So you can point more than the segment your are working. (generaly Data segment).
 

    SphinX

    Points: 2
    Helpful Answer Positive Rating
Re: BYTE far *Temp;

Hi
Far prefix mean that a variable declared have a size of LARGE MODE in memory mode.
if you selected LARGE MODE in memory mode then Far don't need.
Far only use when select COMPACT MODE or SMALL MODE but use LARGE MODE for a variable.(MIXER MODE)
 

Re: BYTE far *Temp;

in small memory model pointer only poins to offset inside the segment but in far

pointer both segment and offset are stored .this is only in 16 bit compilers.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…