R
Random832
2006-12-20 said:Richard Bos a écrit :
Yes, there could be computers where addresses are complex numbers
Or floating point numbers.
Or where they are not numbers of any kind.
2006-12-20 said:Richard Bos a écrit :
Yes, there could be computers where addresses are complex numbers
Or floating point numbers.
2006-12-20 said:Richard Heathfield a écrit :
How can you subtract two non integers and obtain an integer?
Can you explain that with all your rubbish???
Pointer subtraction:
pointer - pointer --> integer
pointer + integer --> pointer
pointer - integer --> pointer
If pointer would NOT be of integer type this could
never work.
2006-12-20 said:How can you subtract two non integers and obtain an integer?
Can you explain that with all your rubbish???
Pointer subtraction:
pointer - pointer --> integer
pointer + integer --> pointer
pointer - integer --> pointer
If pointer would NOT be of integer type this could
never work.
2006-12-20 said:Richard Heathfield a écrit :
This is the whole disagreement. Ok, it has costed us a certain time but
now we are at the heart of it.
No. The segment is not part of the integer that I am referring to.
Random832 said:Now we're getting somewhere - you see, the segment, where such things
are used, _IS_ part of a pointer. Therefore a pointer is not the same
thing as an integer.
onkar said:Thas wrong - Pointers are of the type "unsigned integers".
jacob navia said:Richard Bos a écrit :
Yes, there could be computers where addresses are complex numbers
Or floating point numbers.
So you would access to the address 4677655.2 ...
Addresses are consecutive integers starting with some base offset or
segment. The segment can be implicit, or ignored, etc. There are
many variations, but in ALL cases they are integers numbering
consecutive memory locations.
jacob navia said:Richard Heathfield a écrit :
How can you subtract two non integers and obtain an integer?
Can you explain that with all your rubbish???
Pointer subtraction:
pointer - pointer --> integer
pointer + integer --> pointer
pointer - integer --> pointer
If pointer would NOT be of integer type this could
never work.
jacob navia said:Richard Heathfield a écrit :
This is the whole disagreement. Ok, it has costed us a certain time but
now we are at the heart of it.
No. The segment is not part of the integer that I am referring to.
In the case of my address, Maurice Ravel would not suffice since
there is ALSO a Maurice Ravel street in Montmagny, the next town
after Villetaneuse, where I live. And then, you have to take the
country in consideration etc.
In machine addresses, we have
segment:address, but... which segment?
Code segment, say.
Ok, but that is meaningful only within a certain process. And that is
meaningful only within a certain machine... etc etc.
Using the notation popularized with the web, we could also say
that
address://www.hearthfield.com/home/utilities/backup:CODE_SEGMENT:447766555
is an address. The meaning is to name a particular machine
in a particular configuration that runs the "backup" executable.
But WHICH part is necessary?
It depends on the context. You can say that within the context of a
process, the whole part until the second
':' is not necessary, because all that is implicit.
Within the context of a network, an address could be given a different
prefix.
If you take the prefix within the address, there is no end to the
prefixes you would need, and they change from context to context.
For this reason, I leave the "prefix" OUT of the integer, and retain
just the offset within the segment (obejct).
Addresses are consecutive integers starting with some base offset or
segment.
How can you subtract two non integers and obtain an integer?
never work.
Chris Dollin a écrit :
This are boundary conditions,
since float - float doesn't always
yield an integer. Pointer - pointer yields ALWAYS an integer,
See above. CAN BE, but it is not ALWAYS.
Excuse me but when I come to the railway station I am assigned
an integer by the machine. That integer is my turn. The
employees call the integers aloud, then when I hear my integer
I go to the employee selling the tickets and do my transaction.
Similarly, if you remove all the parts of a floating point value that are
not an integer value, what remains (if anything) is an integer value.
And if you remove all the parts of a coffee mug that are not an integer
value, what remains (if anything) is an integer value.
That does not mean that pointers, floating point values, and coffee mugs are
integers.
jacob navia said:Richard Bos a écrit :
My address is the integer 41.
Offset from the start of the Maurice Ravel segment.
Consecutive memory locations are assigned consecutive integers
within the same segment (or "object", as you wish) of memory.
Obviously you think that if you do not call them integers but
"pointers" and hide some cloack of "mystery" around those
integers things will improve.
Be it. Your opinion is different than mine.
I'm a sock-puppet for pete
jacob navia said:Here's a counter-example:Richard Heathfield a écrit :
Yes they are
#include <stdio.h>
int main(void)
{
int i = 42;
void *p = &i;
printf("[%p]\n", p);
return 0;
}
Output:
[DS:0400]
Are you arguing that DS:0400 is an integer?
On Tue, 19 Dec 2006 10:46:29 +0000, Richard Heathfield wrote:
Output:
[DS:0400]
Are you arguing that DS:0400 is an integer?
no but pointers are numbers,
they are coordinates that find a memory location
because i don't imagine why i have the need of more than 1 coordinate
for identify a memory location, yes pointers are integers
i can say above printf is bugged because not print:
[12:3456]
Marry Christmas
av said:Output:
[DS:0400]
Are you arguing that DS:0400 is an integer?
no but pointers are numbers,
Wrong. It is true that, if you take away all the parts of a pointer that are
not a number, then what remains (if anything) is a number. But that does
not mean pointers are numbers.
You might describe them thus if you like, but that doesn't make them numbers
either.
Computer hardware designers are not limited by your imagination.
i can say above printf is bugged because not print:
[12:3456]
You can say it, but that doesn't make it true. If you want people to treat
your claim seriously, feel free to explain what part of the Standard, if
any, demonstrates that [DS:0400] is not a legal output for printf("[%p]\n",
p).
No, thank you - I am already happily married.
av said:Output:
[DS:0400]
Are you arguing that DS:0400 is an integer?
no but pointers are numbers,
Wrong. It is true that, if you take away all the parts of a pointer that
are not a number, then what remains (if anything) is a number. But that
does not mean pointers are numbers.
for the above example
it should be a 16 bits x86 cpu
"DS" should be a 16bits register. pointer i speak should be the 20
bits integer (int20bits)((ds<<4)|0400)
printf has to write it in the output
you "describe"
i don't "describe" i write "the definition"
you and other appear confuse about the definition of pointers
one integer of appriopriate dimension can find every momery location
why you all want more dimension for find the momory location?
Do you like to do hard what it is easy?
i can say above printf is bugged because not print:
[12:3456]
You can say it, but that doesn't make it true. If you want people to treat
your claim seriously, feel free to explain what part of the Standard, if
any, demonstrates that [DS:0400] is not a legal output for
printf("[%p]\n", p).
could be legal don't know
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.