Thread: How do we know the memory arrangement using in microprocessors? Top-Bottom,Bottom-Top

  1. #16
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    The question is basically meaningless unless you're actually writing a compiler.

    The whole point of C, like all languages which are not assembler is that you're removed from such low level details and can focus on the task at hand.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  2. #17
    Fountain of knowledge.
    Join Date
    May 2006
    However C programs usually run on a microprocessor and knowlegde of the memory may help you track down a bug in a C program.

  3. #18
    Registered User
    Join Date
    Oct 2001
    Quote Originally Posted by Bubba
    This thread makes no sense and at the very least does not belong on this particular board b/c it has nothing to do with C and everything to do with CPU and architecture. Maybe that's why it struck me as irrelevant barring the fact that there is no way to tell unless you read the processor's manual.

    But for the heck of it the Intel tech ref will tell you all you need to know about AMD/Intel CPUs. AFAI remember they can grow either way. I do believe the FPU stack grows down. But I could be wrong since it's been ages since I've messed with it.
    I guess why it struck me as funny is that you used to post assembly on the C board.

  4. #19
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Which I still do from time to time when it's applicable. But more often than not it's not the best solution to the problem.

    But writing assembly in certain areas as opposed to asking how stacks grow on your particular CPU seem a galaxy away from each other so I'm not sure what you are saying. This thread is asking a tech question on how the OP's CPU works which is out of the realm of this board IMO.

    Now if he asked how does an Intel CPU call a function or something specific then I would say it would have some relevance. The question is not specific enough.
    Last edited by VirtualAce; 09-13-2006 at 01:07 PM.

  5. #20
    Registered User
    Join Date
    Sep 2006
    Our target is ARM 7 and we also know the fastest and easiest way is to check the data sheet.
    The rest of work will be taken care of by compilers.

    * * * * * * * * * * * * * * * * * * * *

    When my friend asked me this question, the first though is checking the data sheets of target microprocessors. However, he said "If we have no data sheet or any hardware knowledge of our target, what would you do?" I was silent and thinking. After several hours’ discussion, the only reasonable answer is to checking the addresses of dynamic objects. As you know, it only can tell us how heap grows, not how memory allocates. Then, we decided to post this question on forums. The best discussion is in this thread but still the best way is to check the data sheet.

    Sorry for bother you all and thank you for your valuable opinions.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  2. OpenGL, loading BMP Textures?
    By Zeusbwr in forum Game Programming
    Replies: 12
    Last Post: 12-09-2004, 05:16 PM
  3. Pointer's
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 10-14-2003, 02:15 PM
  4. memory checking a daemon using top
    By rotis23 in forum Linux Programming
    Replies: 3
    Last Post: 11-04-2002, 09:48 AM
  5. Stack functions as arrays instead of node pointers
    By sballew in forum C Programming
    Replies: 8
    Last Post: 12-04-2001, 11:13 AM