Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Pointers and the adresse bus

Pointers and the adresse bus

Scheduled Pinned Locked Moved C / C++ / MFC
c++cssperformancequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ralf Friedrich Hain
    wrote on last edited by
    #1

    My PC is a "32 bit system". That means 32 bit address bus => the highest address is 2^32 - 1 = 4294967296 That means also 32 bit data bus. (4 Byte per word) => the maximum of adressable memory is 4 * (2^32 - 1) = 17179869184 now programming in c/c++: sizeof( char ) = 1 (byte) difference of pointers of two successive char variables : 1 sizeof( int ) = 4 difference of pointers of two successive int variables : 4 sizeof( any Pointer ) = 4 => A char pointer must contain information about which of the 4 bytes in a 32 bit word is meant, and also information of the address on the address bus. => I cannot access the maximum of adressable memory with pointers, but only a fouth of it. (or less?) AM I RIGHT??? Friedrich

    J M 2 Replies Last reply
    0
    • R Ralf Friedrich Hain

      My PC is a "32 bit system". That means 32 bit address bus => the highest address is 2^32 - 1 = 4294967296 That means also 32 bit data bus. (4 Byte per word) => the maximum of adressable memory is 4 * (2^32 - 1) = 17179869184 now programming in c/c++: sizeof( char ) = 1 (byte) difference of pointers of two successive char variables : 1 sizeof( int ) = 4 difference of pointers of two successive int variables : 4 sizeof( any Pointer ) = 4 => A char pointer must contain information about which of the 4 bytes in a 32 bit word is meant, and also information of the address on the address bus. => I cannot access the maximum of adressable memory with pointers, but only a fouth of it. (or less?) AM I RIGHT??? Friedrich

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      The maximum addressable memory is not 4 * (232-1), but rather (232-1), so there is no problem of the sort you describe. What a pointer stores is the address of a single byte (a char, roughly speaking,) not a full 32-bit word. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      • R Ralf Friedrich Hain

        My PC is a "32 bit system". That means 32 bit address bus => the highest address is 2^32 - 1 = 4294967296 That means also 32 bit data bus. (4 Byte per word) => the maximum of adressable memory is 4 * (2^32 - 1) = 17179869184 now programming in c/c++: sizeof( char ) = 1 (byte) difference of pointers of two successive char variables : 1 sizeof( int ) = 4 difference of pointers of two successive int variables : 4 sizeof( any Pointer ) = 4 => A char pointer must contain information about which of the 4 bytes in a 32 bit word is meant, and also information of the address on the address bus. => I cannot access the maximum of adressable memory with pointers, but only a fouth of it. (or less?) AM I RIGHT??? Friedrich

        M Offline
        M Offline
        markkuk
        wrote on last edited by
        #3

        An Intel-architecture PC is a byte-addressable machine but you seem to be thinking about word-addressable machines which are quite rare nowadays. Each byte has its own memory address, so the addressable memory space for a single process (without funny tricks with segment registers) is 4 GiBytes, not 4 GiWords. All the memory space is addressable with 32 bit pointers.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups