answersLogoWhite

0

What is far a pointer?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

Definition: 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.

Most programmers today (as of 2009) never use far pointers.

Instead, most programmers always use 32 bit "flat pointers".

example: int main() {

int a; a=10; printf("%d",&a); return 0;

} Explanation:

When this code is saved/compiled the processor allocates a small amount of memory and memor address is given between the memory range 0 to 65,535.Which is part of the 1mb dos memory ie(10,48,780)bytes.If you want to store data/code beyond the memory range and any where in that 1mb memory.You can do that using the far pointers.By declaring a variable as 'far'pointer.The compiler tells the processor to allocate memory for that specific data/code to perform a specific process in that specific address.The address which is exceeds the 65,535 memory range if referred using the 4 digit hexadecimal number,using the two CPU registers namely segment,offset. While referring to memory address greater than 65,535,the 1mb dos memory is divided into segments,Each segment containing 0 to 65,535 locations(64kb) and to refer these segments the segment register is used.The offset regsiter is used to refer the 65,535 locations present in each segment. So using these two registers(segment:offset)we can refer the entire 1mb memory avialable in Dos.And it is done by writing the segment and offset address side by side like this B8000000.The first four hexadecimal digit represents the segment address and the last four hexadecimal address represents the offset address.

Answernot local. in assembly, there is a certain amount of memory it has to span before being considered "far" AnswerA far pointer uses both the segment and the offset address to point to a location in memory. A near pointer in contrast uses only the offset address and the default segment. The far pointer can point to any location in memory, whereas the near pointer can only point to a nearby local address.

The distinction between near and far is invisible in newer languages such as Visual Basic, C#, and PHP.

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

For example, in an Intel 8086, where an ordinary pointer is just a 16-bit offset within an implied segment, a far pointer has two parts: a 16-bit segment value and a 16-bit offset value. A linear address is obtained by shifting the binary segment value four times to the left, and then adding the offset value. Hence the effective address is 20 bits (actually 21-bit, which led to the address wraparound and the Gate A20). Comparison and arithmetic on far pointers are problematic: there are potentially 4096 different segment-offset address pairs that point to the same address. To compare two far pointers, they must first be converted (normalized) to their 20-bit linear representation.

On C compilers targeting the 8086 processor family, far pointers were declared using a non-standard far qualifier. For example, char far *p; defined a far pointer to a char. The difficulty of normalizing far pointers could be avoided with the non-standard huge qualifier.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

It was a good question twenty years before. For now: ignore it, it has now importance.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is far a pointer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does it mean by huge pointer is normalize give detail about far pointer huge pointer?

On far pointers the comparison operators(== and !=) check the 32 bit value. While >, =,


What is far pointer in c language?

its pointer created for high safety that cant be find by anyone.


Is Far pointer necessary to create a circular linked list?

It has to be a pointer all right.Regarding 'far' and 'near': forget it, simply use 'Large' data modell (or 'Huge').


What is far and near pointer and how are they used?

It is a matter of the memory model you are using. On old or embedded systems, some memory was outside of the range of a normal pointer. If you have 4 megs of ram you need at least a 22bit pointer to see all of it. But let's say you only have a 16 bit pointer. This means you can only access the first 65K of ram. Odd as it may sound, this was a problem on old computers, and is sometimes an issue on embedded devices with limited processing power. The near and far classifications were a solution. Pointers are near by default. In my example above, the 65K of ram would be accessed with a near pointer. To get past that 16 bit limit, you need a far pointer. Thus: memory within the pointer's range is near. Memory outside of the range is far. Near pointer: char near * ptr; Far pointer: char far * ptr;A far pointer uses both the segment and the offset address to point to a location in memory. A near pointer in contrast uses only the offset address and the default segment. The far pointer can point to any location in memory, whereas the near pointer can only point to a nearby local address.Something that was important 20 years ago. Now you can forget it.


How far can a 5mw laser pointer go?

10 ft


How far does a 1mW laser pointer go?

200 miles


When should a far pointer be used?

Never. 'near' and 'far' pointers are outdated by twenty years!


How far is the three pointer from the basket in high school?

20 feet


How far is 3-pointer in college?

20 feet and 9 inches


How far is a three pointer from the basket?

20 feet from the basketball rim.


How do you change scrin coulor using far pointer in c ganguage?

brown


How far is the 3 pointer line?

Around 18ft.