Re: working with addresses

From: Josh Sebastian (curien_at_cox.net)
Date: 01/12/04


Date: Sun, 11 Jan 2004 19:39:01 -0500

On Mon, 12 Jan 2004 00:18:20 +0000, pcrAKAJumbo wrote:

> "Richard Heathfield" <dontmail@address.co.uk.invalid> wrote in message
> news:btsfup$ieg$1@hercules.btinternet.com...
>> pcrAKAJumbo wrote:
>
> But if you CPU is addressing in 32 bit mode you cannot simply start
> addressing with 10 bit addresses.
> That's nonsense.

Pentium4 CPUs have two addressing modes: 32-bit and 36-bit.
In the early x86 days, there were 16- and 32-bit addressing modes.

And that's just a couple of examples for PCs. If you leave the x86 world,
it can get even more convoluted.

>> in a 32-bit array, he would prefer to see:
>>
>> 00000000110011101011001010111110
>>
>> rather than
>>
>> 11001110101100101011111000000000
>>
> Too right I don't understand it.
> What the heck are you talking about now? These are two completely
> different numbers.

They both have the same bit-sequence, just aligned differently.

> Yes but in this example I am *obviously* talking about a PC with a 32
> bit address bus.

Is an "address bus" what addresses use to get to work in the morning? ;-}

> I claimed that on a 32 *system* the pointers will be 4 bytes

My 32-bit system can use 36-bit pointers. Chances are, yours can too (P4s
being the most common desktop 32-bit CPU these days).

>> Consider a system which stores long * in 24-bit pointers and int * in
> 32-bit
>> pointers. On such a system, converting an int * into a long *
>> inevitably loses information. Such a conversion is "lossy". A
>> "lossless" conversion
> is
>> one which does not lose information.
>>
> But there is no such a system. CPU's operate in specific modes

No, they don't.

> now I don't claim to be an expert on CPU's

Noted.

> but I know that with the Intel CPU
> you need to change the CPU mode to change memory addressing size

No, you just need to use certain CPU instructions.

> But guarantee is a bit of a strong word , the standards do not guarantee
> anything

The "guarantee" is just like a money-back guarantee at Wal-Mart: if you're
compiler claims to follow the standard and doesn't, you can get your money
back. :-}

"Guarantee" does not mean that there exist no counter-examples.

Josh



Relevant Pages

  • Re: OpenVMS Architect/Consultant Position Available
    ... space in the longword space of the CPU. ... byte addresses on the bus were found on longword address from the CPUs ... led to "sparse mode" addressing in PCI space. ...
    (comp.os.vms)
  • Re: OpenVMS Architect/Consultant Position Available
    ... space in the longword space of the CPU. ... byte addresses on the bus were found on longword address from the CPUs ... led to "sparse mode" addressing in PCI space. ...
    (comp.os.vms)
  • Re: [RFC][PATCH][2.6.6] Replacing CPU scheduler active and expired with a single array
    ... > interactive task had used too long a burst of cpu which was ... > addressing the interactive tasks and had the best effect. ... zero and as they probably do much the same amount of work each CPU burst ... the scheduler relies on the interactive bonus to make sure ...
    (Linux-Kernel)
  • Re: i8086 architectural fix
    ... assembler programmers and CPU ... managed 16+16 addressing ... release a cheaper CPU years ago. ... the genuine, original Intel x86 processor. ...
    (comp.arch)
  • [git pull] x86 updates for v2.6.28, phase #6, misc
    ... tip/x86/core: various x86 updates independent of the sparse irqs support ... separate generic cpu disabling code from APIC writes in cpu_disable ... convert hardware exception 0 to an interrupt gate ... +void printk_address ...
    (Linux-Kernel)