Sie sind auf Seite 1von 1

This is based on x86. But you can get the meaning...

It may happen that far pointers holding different addresses may refer to the same memory location. This deduces from the method of obtaining
the 20-bit physical address from the segment:offset pair. This is shon belo for three different addresses:
!onsider the three addresses: 0"00000#20$ 0"00#00020 and 0"00#20000
00000 segment address left shifted by % bits
0#20 offset address
&&&-
00#20 resultant 20-bit address
00#00 segment address left shifted by % bits
0020 offset address
&&&-
00#20 resultant 20-bit address
00#20 segment address left shifted by % bits
0000 offset address
&&&-
00#20 resultant 20-bit address
'nli(e far pointers huge pointers are )normali*ed+ to a,oid these problems. - normali*ed pointer is a .2- bit pointer$ hich has as much of its
,alue in the segment address as possible. /ince a segment can start e,ery #6 bytes$ this means that the offset ill only ha,e a ,alue from 0 to 0.
To normali*e a pointer$ first it is con,erted to its 20-bit address then the left #6 bits are used for the segment address and the right % bits for the
offset address. 0or example$ gi,en the pointer 1002:3%04$ con,erting it to a 20-bit absolute address gi,es 13%24$ hich is then normali*ed to
13%2:0004.
huge pointers are alays (ept normali*ed. -s a result for any gi,en memory address there is only one possible huge address&segment:offset
pair&for it. This is more logical than the result obtained hile using far pointers.
But then there is a price to be paid for using huge pointers. 5uge pointer arithmetic is done ith calls to special subroutines. Because of this$
huge pointer arithmetic is significantly sloer than that of far or near pointers

Das könnte Ihnen auch gefallen