What is the difference between far pointer and huge pointer




















A far pointer is typically 32 bit that can access memory outside current segment. To use this, compiler allocates a segment register to store segment address, then another register to store offset within current segment. Like far pointer, huge pointer is also typically 32 bit and can access outside segment. In case of far pointers, a segment is fixed.

In far pointer, the segment part cannot be modified, but in Huge it can be. Log in. Computer Programming. C Programming. The Difference Between. Study now. See Answer. Best Answer. Huge pointers are fully recognised and evaluated for their entire width. Answer Near pointers have a size of 2 bytes. They only store the offset of the address the pointer is referencing. 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. Study guides. Software and Applications non-game 20 cards. What is a programming language. What does DOS stand for. What is a software that is distributed for free. What is application software.

Software and Applications non-game 21 cards. Software and Applications non-game 23 cards. Q: What is the difference between far pointer and huge pointer in C programming language? A far pointer is typically 32 bit that can access memory outside current segment. To use this, compiler allocates a segment register to store segment address, then another register to store offset within current segment.

Like far pointer, huge pointer is also typically 32 bit and can access outside segment. In case of far pointers, a segment is fixed. In far pointer, the segment part cannot be modified, but in Huge it can be. Skip to content. Change Language.

So when an address pointed to by a pointer is within the same segment, then it is a near pointer and therefore it requires only 2 bytes for offset. On the other hand, when a pointer points to an address which is out of the segment that means in another segment , then that pointer is a far pointer.

It consist of 4 bytes: two for segment and two for offset. Four registers are used to refer to four segments on the bit x86 segmented memory architecture. A logical address on this platform is written segment:offset, in hexadecimal. Well in DOS it was kind of funny dealing with registers.

And Segments. All about maximum counting capacities of RAM. Today it is pretty much irrelevant. And avoided direct access to physical controllers since then.

Since then dissapered a problem dealing with direct access to memory segments as well. I would like to point out to perfect answer below.. I was too lazy to answer properly. Lundin gave very detailed and sensible explanation "thumbs up"! Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. What is the difference between far pointers and near pointers? Ask Question. Asked 11 years, 11 months ago.

Active 2 years, 1 month ago. Viewed 70k times. Improve this question. Lundin k 35 35 gold badges silver badges bronze badges. Madhan Madhan 2, 7 7 gold badges 25 25 silver badges 22 22 bronze badges. Add a comment. Active Oldest Votes. Now to answer the question: Near pointers refer as an offset to the current segment.



0コメント

  • 1000 / 1000