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

PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

1717


How can type-insensitive macros be created?

702


How do you initialize pointer variables?

615


What is the purpose of main( ) in c language?

624


How can I invoke another program or command and trap its output?

619






what is the syallabus of computer science students in group- 1?

1845


What are the advantages of Macro over function?

1207


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

604


What are the two types of structure?

579


What do you mean by c what are the main characteristics of c language?

573


Explain c preprocessor?

684


string reverse using recursion

1813


What are the types of variables in c?

582


What does typedef struct mean?

663


Why should I prototype a function?

643