Hi folks,
This question is a little deep into memory management of microprocessor.
How do we know the memory arrangement using in microprocessors? Top-Bottom or Bottom-Top?
For example, the "Top-Bottom" is arranging memory resource from higher address to lower address.
If we have no hardware knowledge of microprocessors, how can we know the arrangement of microprocessors?
I have idea which is declearing an array and check the addresses of array elements because the allocation of array elements is sequential. And, then, we know how memory resource is arranged.
BUT, is there any other way to find out?
Code:// My complier is gcc v4.1.1 #include <stdio.h> int main (void) { char var[10]; int i; for ( i = 0; i < 10; i++) printf("addr = %X\n", &var[i]); return 0; } // Bottom-Top arrangement: // Result: $ ./addr addr = BF9CEF66 addr = BF9CEF67 addr = BF9CEF68 addr = BF9CEF69 addr = BF9CEF6A addr = BF9CEF6B addr = BF9CEF6C addr = BF9CEF6D addr = BF9CEF6E addr = BF9CEF6F $