Thread: Boundary question

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    38

    Boundary question

    In a 32 bit processor if I want to access 8 bit or 16 bit data from RAM, how do processor manage?
    Does it access 4 bytes and disposes remaining three?

    Note: This is regarding ARM processor.

    Please let me know.

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Well, it doesn't 'dispose' of the data, you just 'mask off' what you don't need.

    For instance, on intel processors, the register 'eax' can be accessed by:

    [ al ][ ah ]
    [ <-- ax -->]
    [ <-------- eax ---------> ]
    [byte][byte][byte][byte]

    Of course I don't know 'for sure' that it can't access a single byte, just assuming there.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM