解释c中近,远和巨大指针之间的区别? [重复]

时间:2022-09-16 14:17:57

Possible Duplicate:
difference between far pointer and near pointer in C

可能重复:C中远指针和近指针之间的差异

I searched in GOOGLE for the difference between these three pointers. But I found out the difference between any of the two pointers.

我在GOOGLE中搜索了这三个指针之间的区别。但我发现了两个指针中的任何一个之间的区别。

Can you give Detailed Explanation of this please?

你能详细解释一下吗?

2 个解决方案

#1


19  

The differences are only relevant on 16 bit intel architectures.

这些差异仅与16位英特尔架构有关。

As far as virtual addresses is concerned, It has two components - a selector and an offset.

就虚拟地址而言,它有两个组件 - 选择器和偏移量。

The selector is an index into a table of base addresses and offset is added onto that base address.

选择器是基址地址表的索引,偏移量被添加到该基地址。

near pointers don't have a selector - they have an implied selector. They can access 64k off the virtual address space.

指针附近没有选择器 - 它们有一个隐含的选择器。他们可以从虚拟地址空间访问64k。

far pointers have an explicit selector. However when you do pointer arithmetic on them the selector isn't modified.

far指针有一个明确的选择器。但是,当您对它们执行指针运算时,不会修改选择器。

huge pointers have an explicit selector. When you do pointer arithmetic on them though the selector can change.

巨大的指针有一个明确的选择器。当你对它们进行指针运算时,虽然选择器可以改变。

Please Refer this link for more info:

请参阅此链接以获取更多信息:

http://www.codeproject.com/Answers/103115/near-vs-far-vs-huge-pointers/?cmt=11086#answer1

#2


4  

Near, far, and huge pointers aren't part of standard C; they are/were an extension put in by several vendors to deal with segmented memory architectures. Karthik's answer gives much more detail.

近,远和巨大的指针不是标准C的一部分;它们是几个供应商为处理分段存储器架构而进行的扩展。 Karthik的回答提供了更多细节。

#1


19  

The differences are only relevant on 16 bit intel architectures.

这些差异仅与16位英特尔架构有关。

As far as virtual addresses is concerned, It has two components - a selector and an offset.

就虚拟地址而言,它有两个组件 - 选择器和偏移量。

The selector is an index into a table of base addresses and offset is added onto that base address.

选择器是基址地址表的索引,偏移量被添加到该基地址。

near pointers don't have a selector - they have an implied selector. They can access 64k off the virtual address space.

指针附近没有选择器 - 它们有一个隐含的选择器。他们可以从虚拟地址空间访问64k。

far pointers have an explicit selector. However when you do pointer arithmetic on them the selector isn't modified.

far指针有一个明确的选择器。但是,当您对它们执行指针运算时,不会修改选择器。

huge pointers have an explicit selector. When you do pointer arithmetic on them though the selector can change.

巨大的指针有一个明确的选择器。当你对它们进行指针运算时,虽然选择器可以改变。

Please Refer this link for more info:

请参阅此链接以获取更多信息:

http://www.codeproject.com/Answers/103115/near-vs-far-vs-huge-pointers/?cmt=11086#answer1

#2


4  

Near, far, and huge pointers aren't part of standard C; they are/were an extension put in by several vendors to deal with segmented memory architectures. Karthik's answer gives much more detail.

近,远和巨大的指针不是标准C的一部分;它们是几个供应商为处理分段存储器架构而进行的扩展。 Karthik的回答提供了更多细节。