matrixofdynamism
Advanced Member level 2
I am all confused about memory. Variables are stored in memory, yes I know (I am talking from an Embedded System's perspective.)
But we have Cache with different levels, we have RAM (outside the CPU chip perhaps), we have ROM (with the program stored on it), we have concept of Stack and Heap and much more that I can't recall.
Now to the question itself. When program runs, where are the instructions being run stored at? And related to this is my question: What is main memory as in: Is it the cache, the RAM, the ROM the Flash memory? Which one of them has the program instructions stored and which one has the variables being worked upon stored at, the RAM or the Cache?
My confusion stems from the abstraction of Stack and Heap, but than no explanation of WHERE the stack and heap is actually located.
Finally, with 512 bytes of a RAM and 2k or ROM available, how much memory do we have to store volatile variables? They are stored in registers that are located in Cache or RAM or ROM Or.. ???? (
But we have Cache with different levels, we have RAM (outside the CPU chip perhaps), we have ROM (with the program stored on it), we have concept of Stack and Heap and much more that I can't recall.
Now to the question itself. When program runs, where are the instructions being run stored at? And related to this is my question: What is main memory as in: Is it the cache, the RAM, the ROM the Flash memory? Which one of them has the program instructions stored and which one has the variables being worked upon stored at, the RAM or the Cache?
My confusion stems from the abstraction of Stack and Heap, but than no explanation of WHERE the stack and heap is actually located.
Finally, with 512 bytes of a RAM and 2k or ROM available, how much memory do we have to store volatile variables? They are stored in registers that are located in Cache or RAM or ROM Or.. ???? (