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

The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1018


What is the acronym for ansi?

809


What are the types of assignment statements?

828


What is the difference between c &c++?

846


What is cohesion and coupling in c?

797


Does c have function or method?

797


how is the examination pattern?

1790


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1453


What is the purpose of macro in C language?

857


How do you construct an increment statement or decrement statement in C?

996


What are the advantages of Macro over function?

1617


Explain how can you avoid including a header more than once?

821


What is a stream in c programming?

826


What are the types of type specifiers?

807


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2798