what is a far pointer




Answers were Sorted based on User's Feedback



what is a far pointer..

Answer / sujith

I am not very sure what Bhardwaj is trying to answer with a
secondary memory. If he point out something to your hard
disk or something like that, i think i cannot agree with that.

Any pointer by default is a near pointer. another set of
pointers are far and huge, and they differ only in terms how
they store the value of the normalised pointer value.

A far/huge pointer is used to access a location which is
outside your current segment.

Is This Answer Correct ?    53 Yes 10 No

what is a far pointer..

Answer / imran hassan bergi

Near pointers have a size of 2 bytes. They only store the
offset of the address the pointer is referencing. An
address consisting of only an offset has a range of 0 - 64K
bytes starting from the beginning of DGROUP. A near pointer
can be incremented and decremented using arithmetic
operators (+, -, ++, and --) through the entire address
range. Any attempt to increment a near pointer that has a
value of 64K (0xffff) will result in a value of 0. This is
referred to as wrapping the pointer. A corresponding result
can be expected when attempting to decrement a pointer that
contains an address of 0, except the result will be 64K
instead of 0. In addition to being incremented and
decremented, near pointers can be compared to one another
using relational operators ( <, >, ==, >= and <= ). 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. 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). When a far pointer is
decremented from zero it will wrap the other way and become
64K. 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. Huge
pointers have a size of 4 bytes. They store both the
segment and the offset of the address the pointer is
referencing. A huge pointer has an address range of 0 - 1M
bytes. A huge pointer can be incremented and decremented
using arithmetic operators. The only difference between a
far pointer and a huge pointer is that a huge pointer is
normalized by the compiler. A normalized pointer is one
that has as much of the address as possible in the segment,
meaning that the offset is never larger than 15. A huge
pointer is normalized only when pointer arithmetic is
performed on it. It is not normalized when an assignment is
made. You can cause it to be normalized without changing
the value by incrementing and then decrementing it. The
offset must be less than 16 because the segment can
represent any value greater than or equal to 16 (e.g.
Absolute address 0x17 in a normalized form would be
0001:0001. While a far pointer could address the absolute
address 0x17 with 0000:0017, this is not a valid huge
(normalized) pointer because the offset is greater than
0000F.). Huge pointers can also be incremented and
decremented using arithmetic operators, but since they are
normalized they will not wrap like far pointers. Huge
pointers can be reliably used with relational operators
because they are normalized. This works because
normalization of huge pointers insures that every huge
pointer is unique. It is important to understand that huge
pointers are never the default pointer, even in the huge
memory model.

Is This Answer Correct ?    27 Yes 5 No

what is a far pointer..

Answer / sanjiv sharma

a far pointer is a pointer which includes a segment
selector, making it possible to point to addresses outside
of the current segment.

Is This Answer Correct ?    22 Yes 3 No




what is a far pointer..

Answer / gopal

Far Pointer: A far pointer is that which will point anywhere
in the X MB across segments by containing segment+offset .
far pointers are the normalized pointers of four bytes which
are used to access the main memory of the computer ?it can
access both the data segment and code segment thus by
modifying the offset u can modify refer two different
addresses but refer to the same memory .
Far pointers are not Normalized.

Is This Answer Correct ?    17 Yes 2 No

what is a far pointer..

Answer / jagdeep

Far pointer is 4 byte poinetr and near pointer is 2 byte
pointer.Far pointer is used to point any specified memory
location but near pointer is used to specify only main
memory location.

Is This Answer Correct ?    10 Yes 1 No

what is a far pointer..

Answer / rachna

far pointer is a pointer that include segment
selector.which is used to select a segment that is outside
the current segment.

Is This Answer Correct ?    11 Yes 4 No

what is a far pointer..

Answer / sankar

in OS the memory is divided into segments.
so by using near pointer we can point with in the same segment.
where as by using far pointer we can point any segment in
the memory.

Is This Answer Correct ?    7 Yes 4 No

what is a far pointer..

Answer / praveen kondapaturi

A far/huge pointer is used to access a location which is
outside your current segment.

It includes a segment selector, making it possible to point
to addresses outside of the current segment.

Is This Answer Correct ?    0 Yes 0 No

what is a far pointer..

Answer / mrs.ahmer

A far pointer is a pointer which includes segment number.
In a segmented architecture computer, far pointers are used
to address the entire 1mb memory which is available under
Dos.

Is This Answer Correct ?    0 Yes 1 No

what is a far pointer..

Answer / 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



More C Interview Questions

Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }

3 Answers   NDS,


What is external and internal variables What is dynamic memory allocation what is storage classes in C

3 Answers  


What is the difference between abs() and fabs() functions?

0 Answers  


What’s a signal? Explain what do I use signals for?

0 Answers  


Explain what is output redirection?

0 Answers  






Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

0 Answers  


write a program in c to print **** * * * * ****

1 Answers   TCS,


what are two kinds of java

2 Answers  


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

0 Answers   HP,


marge linklist

0 Answers   HCL,


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }

6 Answers  


Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .

4 Answers   State Bank Of India SBI,






Categories