473,699 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pointer normalization

Dear all,

can any one explain what is meant by pointer normalization
given here:-

http://c-faq.com/ansi/norml.html
Jun 27 '08 #1
22 2449
sophia said:
Dear all,

can any one explain what is meant by pointer normalization
given here:-

http://c-faq.com/ansi/norml.html
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object, but with
different object representations , then p1 == p2 is required to yield 1, so
the implementation must (behave as if to) supply code to "normalise" the
pointer values used in the comparison - i.e. to convert one or the other
or both to a common form. (This was perfectly common in MS-DOS days.)

Note that the same requirement (of identifying the equality of those two
pointers) is not imposed on memcmp(&p1, &p2, sizeof p1).

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #2
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.i nvalidwrote:
sophia said:
Dear all,
can any one explain what is meant by pointer normalization
given here:-
http://c-faq.com/ansi/norml.html

It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object, >but with different object representations ,
Object in C means region of data storage isn't it ?

i am not getting your point,
same object with different representations ?
Jun 27 '08 #3
On 16 Apr, 13:33, sophia <sophia.ag...@g mail.comwrote:
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.i nvalidwrote:
*can any one explain what is meant by pointer normalization
given here:-
>http://c-faq.com/ansi/norml.html
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object,
but with different object representations ,

Object in C means region of data storage isn't it ?

i am not getting your point,
*same object with different representations ?
not possible on a sane architecture, but see the "Segmentati on"
section of http://en.wikipedia.org/wiki/Intel_8086
--
Nick Keighley


Jun 27 '08 #4
sophia said:
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.i nvalidwrote:
>sophia said:
Dear all,
can any one explain what is meant by pointer normalization
given here:-
>http://c-faq.com/ansi/norml.html

It is possible for a pointer value to have more than one object
representation . If p1 and p2 are two pointers to the same object, >but
with different object representations ,

Object in C means region of data storage isn't it ?

i am not getting your point,
same object with different representations ?
Consider MS-DOS's 20-bit pointers, where logical addresses are described by
two 16-bit values, called "segment" and "offset" respectively. To get the
physical address, we left-shift the segment value by four bits, and then
add the offset value.

Logical Logical Physical
segment offset address
address address
0001 1030 01040
0002 1020 01040
0003 1010 01040
0004 1000 01040
0005 00F0 01040

etc.

Five different pointer representations , all pointing to the same physical
object. All must compare equal when compared with ==. The implementation
is responsible for making this work.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #5
In article <aY************ *********@bt.co m>,
Richard Heathfield <rj*@see.sig.in validwrote:
....
>Consider MS-DOS's 20-bit pointers, where logical addresses are described by
two 16-bit values, called "segment" and "offset" respectively. To get the
physical address, we left-shift the segment value by four bits, and then
add the offset value.
A nitpick surely worthy of this group...

It's not "MS-DOS's 20-bit pointers". This is a feature of the 8086
processors (and its descendants, running in "real mode"). It is not a
function of the OS in any way.

Further note that the descendants still maintain this functionality; it
is just that it is rarely used. It is no longer necessary (at least up
to the 4G mark. I'm not sure what happens if you have a machine with
more than 4G RAM).

Jun 27 '08 #6
In article <fu**********@n ews.xmission.co m>,
Kenny McCormack <ga*****@xmissi on.xmission.com wrote:
>In article <aY************ *********@bt.co m>,
Richard Heathfield <rj*@see.sig.in validwrote:
...
>>Consider MS-DOS's 20-bit pointers, where logical addresses are described by
two 16-bit values, called "segment" and "offset" respectively. To get the
physical address, we left-shift the segment value by four bits, and then
add the offset value.

A nitpick surely worthy of this group...
And note that a *real* first-class nitpicker would point out that it's
not even *MS*-DOS, as if this functionality were someone unique to
and/or invented by Microsoft...

Jun 27 '08 #7
sophia wrote:
>
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.i nvalidwrote:
sophia said:
Dear all,
can any one explain what is meant by pointer normalization
given here:-
>http://c-faq.com/ansi/norml.html
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object,
but with different object representations ,

Object in C means region of data storage isn't it ?

i am not getting your point,
same object with different representations ?
Consider, for example, "real mode" on an x86 CPU. On that particular
platform, addresses are represented by a 16-bit segment and a 16-bit
offset. (The physical address is segment*16+offs et.) Using this
particular architecture, the following segment/offset pairs all point
to the same physical address:

1234:0000
1230:0040
1200:0340
1000:2340
and even
1111:1230
0235:FFF0

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Jun 27 '08 #8
Kenny McCormack wrote:
In article <aY************ *********@bt.co m>,
Richard Heathfield <rj*@see.sig.in validwrote:
...
>Consider MS-DOS's 20-bit pointers, where logical addresses are described by
two 16-bit values, called "segment" and "offset" respectively. To get the
physical address, we left-shift the segment value by four bits, and then
add the offset value.

A nitpick surely worthy of this group...

It's not "MS-DOS's 20-bit pointers". This is a feature of the 8086
processors (and its descendants, running in "real mode"). It is not a
function of the OS in any way.
Well if we're nitpicking.. :P
He didn't claim ms-dos 'owns or invented' the concept. He just offered
it as an example. MS-DOS did in fact have 20bit pointers because it ran
on 8086.
Jun 27 '08 #9
In article <48********@new s.acsalaska.net >, anoncoholic <no@no.netwrote :
>Kenny McCormack wrote:
>In article <aY************ *********@bt.co m>,
Richard Heathfield <rj*@see.sig.in validwrote:
...
>>Consider MS-DOS's 20-bit pointers, where logical addresses are described by
two 16-bit values, called "segment" and "offset" respectively. To get the
physical address, we left-shift the segment value by four bits, and then
add the offset value.

A nitpick surely worthy of this group...

It's not "MS-DOS's 20-bit pointers". This is a feature of the 8086
processors (and its descendants, running in "real mode"). It is not a
function of the OS in any way.

Well if we're nitpicking.. :P
He didn't claim ms-dos 'owns or invented' the concept. He just offered
it as an example. MS-DOS did in fact have 20bit pointers because it ran
on 8086.
I doubt the MSDOS standards document uses the phrase "20 bit"...

Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3172
by: JoeB | last post by:
I found an interesting thread on this from Nov., 2000, but it didn't fully answer my question. I understand normalization, but am trying to find the line between good database design and personal preference. I'm wondering if I've created too many tables. Normalization as I understand it would be to create tables if a field can have more than one occurrance (for example, book titles by an author). But if a field will only have one value,...
2
1479
by: Kostas | last post by:
Hi all, I strived understanding the concepts of all normal forms up to the domain-key normal form but there are some issues I still am unsure of, and I will describe the first one in this post. (it looks so simple that there has to be an answer) Suppose a relation that holds information about Phone Numbers: PhoneNumber (PhoneID, ActualNumber, PhoneType, Comments)
7
2455
by: John Welch | last post by:
I have three tables and the way they are currently set up violates good normalization, but I'm having trouble figuring out a better way. Can someone suggest a more elegant solution? My tables are: tblCompanies: CompanyID - PK other fields like address, type of business, etc
26
774
by: Meenu | last post by:
Hi, Can two different far pointers contain two different addresses but refer to the same location in memory?
20
6920
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an "Outcomes Database" used to store response data from measures/ questionnaires for a longitudinal health study. It is essentially derived from Duane Hookom's Survey Database (thanks Duane!!!), with many modifications added to fit the needs of my lab.
1
2023
by: weird0 | last post by:
I know that is not the appropriate group for asking this question, but I do not know of any better forum. Can anyone plz explain clearly what normalization is? The first three normal forms upto 3NF and BCNF. I know the first one but the remaining ones are really confusing. The language changes dramatically into functional dependencies x---y, all that, and normalization, the real topic is lost in between. Decent explanation or good...
0
8623
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6539
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5878
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4635
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3064
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.