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.
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.
However C programs usually run on a microprocessor and knowlegde of the memory may help you track down a bug in a C program.
I guess why it struck me as funny is that you used to post assembly on the C board.Originally Posted by Bubba
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.
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.
Cuthbert