far Pointers…

A far pointer holds a 32-bit address. To address a location which is outside the normal data segment, the segment:offset scheme should be used. For example, when a pointer is to point at a location in B block of memory, the segment:offset scheme which gives a 20-byte absolute address should be used.

However, instead of using an absolute 20-bit address, C uses a 32- bit representation consisting of a 16-bit segment, followed by a 16-bit offset address. Thus, the segment:offset pair of 0xB000:0×8000 is converted to 0xB0008000. But now the problem is a normal pointer can’t hold 32-bit addresses. Therefore, far keyword is used which tells the compiler to treat the pointer as a 32-bit pointer. Thus, a far pointer is the one that holds a 32-bit address, rather than the usual 2-byte address and contains both the segment address and an offset address.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>