Is it necessary to normalize pointers before comparism in VC++?
( In C it was, because pointer to the same place could have different
segment and offset addresses)
It depends on the type of the pointer you are using. If u are using a far pointer, then u should be normalizing but not the case for a huge pointer.
If you add values to a far pointer, only the offset is changed. If you add enough to cause the offset to exceed FFFF (its maximum possible value), the pointer just wraps around back to the beginning of the segment. For example, if you add 1 to 5031:FFFF, the result would be 5031:0000 (not 6031:0000). Likewise, if you subtract 1 from 5031:0000, you would get 5031:FFFF (not 5030:000F).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.