what is a far pointer

Answer Posted / lalit kumar

Far pointers have a size of 4 bytes. They store both the
segment and the offset of the address the pointer is
referencing. A far pointer has an address range of 0 - 1M
bytes. It is important to understand that an addressing
range of 1M does not remove the 640K barrier from the
program. It means that the pointer can address the upper
memory area (641 - 1M) which typically contains video
memory, ROM and anything else that may be loaded high.
1: A far pointer can be incremented and decremented using
arithmetic operators. When a far pointer is incremented or
decremented ONLY the offset of the pointer is actually
incremented or decremented. The segment is never incremented
by the arithmetic operators. This means that although a far
pointer can address up to 1Mb of memory, it can only be
incremented through 64Kb and the offset will start at zero
again without changing the value of the segment. This is
referred to as "wrapping" the pointer
(e.g. 0F3E:FFFF + 1 = 0F3E:0000).
2:When a far pointer is decremented from zero it will wrap
the other way and become 64K.
3:Far pointers are not unique. It is possible to have two
far memory addresses that have different segments values and
different offset values that address the same memory
location e.g. 0777:2222 has an absolute address of
07770 + 2222 = 09992 and 0999:0002 has an absolute address
of 09990 + 0002 = 09992. When relational operators are used
on far pointers only the offsets are compared. For example:
if we let a = 0777:2222 and let b = 0999:0002 then a == b
would return false because this is equivalent to 2222 ==
0002 which is in fact false. In other words relational
operators will only work on far pointers if the segment
values of the pointers being compared are the same.

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I round numbers?

794


What will be the outcome of the following conditional statement if the value of variable s is 10?

1070


What is a void * in c?

857


What is the difference between procedural and functional programming?

760


Do you have any idea about the use of "auto" keyword?

891


what are enumerations in C

948


How can you convert integers to binary or hexadecimal?

816


What is external variable in c?

835


What is scanf_s in c?

869


What is a const pointer?

828


difference between Low, Middle, High Level languages in c ?

1872


number of times a digit is present in a number

1807


Does free set pointer to null?

771


How can I use a preprocessorif expression to ?

801


What is use of pointer?

813