Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Pointers&Hardware limitations

Name: Anonymous 2011-09-26 9:50

Suppose you have a machine with more addressable memory cells than the size of an integer. Since the pointer cannot contain the address of integers in cells whoms address exceed its size, does this means it cannot point at said cells?

Applying the same idea to the largest primitive type possible in a system, does this means its length is the absolute limit of what pointers can point to?

Name: Anonymous 2011-09-26 9:52

Yes.

Name: FrozenVoid 2011-09-26 9:55

Name: Anonymous 2011-09-26 10:29

Why would the size of an integer limit the size on a pointer? There is no requirement that sizeof(int) == sizeof(void*).

Name: Anonymous 2011-09-26 11:06

>>3
lol i remember that.

bankswithching and vga cards. :)

Name: Anonymous 2011-09-26 11:26

HELLO WHY DO YOU THINK YOU HAVE 640K MEMORY ON DOS AND HAD TO USE EXTRA SHIT (EMM386 OR HIMEM) TO USE MORE MEMORY.

Name: Anonymous 2011-09-26 11:26

Bank switching does not expand the address space. It's a way to fit more into the address space, but is not relevant.

A better example is the use of segment:offset addressing as used in x86 real mode. Two 16-bit registers are combined to form one 20-bit address.

Name: Anonymous 2011-09-26 11:56

>>1
It can't point directly, as expected, but there might be a scheme with which the addressing range is expanded indirectly. Manipulating the A20 address line on x86 real mode is such a way.

Also, if you combine two words to form a greater word you can address a much wider range -- but that'd be rather equivalent of just extending the pointer size.

>>4
Yes, there's intptr_t for that.

Name: Anonymous 2011-09-26 12:30

>>8
intptr_t and uintptr_t are optional.

Take for example the 68k architecture, which has different register classes for data (registers D0-D7) and addresses (A0-A7). In all current implementations the width of the address registers and data registers are the same, but you could double the width of the address registers without breaking anything.

Name: Anonymous 2011-09-26 12:43

what if....
we could use floats as the default pointer instead of just a DWORD?

Name: FrozenVoid 2011-09-26 12:52

>>10
Using (long)double could be possible if its treated as integer, but it needs hardware support.
I assume the point is not to map floating point to memory cells but use it as int64_ptr

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List