I have a lot of confusion on understanding the difference between a \"far\" pointer and \"huge\" pointer, searched for it all over in google for a solution, couldnot find on
First thing to understand is how a segmented pointer is converted into a linear address. For the example you have, the conversion is:
linear = segment * 16 + offset;
Because of that, it turns out there there the same linear address can be expressed using different segment/offset combinations. For example, the following segment/offset combinations all refer to the same linear address:
0004:0000
0003:0010
0002:0020
0001:0030
0000:0040
The problem with this is that if you have ptr1 with a segmented address of 0100:0000
and ptr2 with a segmented address of 0010:0020
, a simple comparison will determine that ptr1 != ptr2
even though they actually point to the same address.
Normalization is the process by which you convert an address to a form such that if two non-normalized pointers refer to the same linear address, they will both be converted to the same normalized form.