In: Computer Science
Following is the memory layout of the CP/M:
And in this case, if we see for the memory available for program
use is the memory which is used for stack and heap memory and they
are expanding in opposite directions.
It is helpful as while running the program we don't know which
memory is going to end up first beforehand, so we simply make them
expand in opposite directions as we have very limited space of
memory. So when they both meet each other which is the significant
point when we end up with the free memory which we have.
But the OS here, in this case, is at the top of the memory just as to insure as this is the one which actually contains different programs which are going to be run. So it should be there at the top of the memory to access it easily and the memory required for the programs will be taken from the bottom
If you have any
doubts, do let me know in the comment section
Thanks