Unit – II 2 Mark Questions and Answers
1. What is Code Space? The code space stores the instructions. It makes sense to make the system space and the code space contiguous because you would normally place them in the same physical ROM device.
2. What is Data Space?
Above the code space, the ROM data space stores constant values, such as error messages or other string literals.
3. What are the three basic areas of read /write storage (RAM) need to be identified?
Three basic areas of read/write storage (RAM) need to be identified: stack, free memory, and heap. 4. What is the use of stack?
The stack is used to keep track of the current and all suspended execution contexts. Thus, the stack contains all “live” local or automatic variables and all function and interrupt “return addresses.” When a program calls a function.
5. Where is the stack placed in a memory?
The stack is generally placed at the upper end of memory because the stack grows downwards towards the heap. Placing the stack at the “right” end of RAM means that the logical bottom of the stack is at the highest possible RAM address, giving it the maximum amount of room to grow downwards.
6. What is Free Memory?
All statically allocated read/write variables are assigned locations in free memory. Globals are the most common form of statically allocated variable, but C “statics” are also placed here. Any modifiable variable with global life is stored in free memory.
7. What is Heap?
All dynamically allocated (created by new or malloc()) objects and variables reside in the heap. Usually, whatever memory is "left over" after allocating stack and free memory space is assigned to the heap. The heap is usually a (sometimes complex) linked data structure managed by routines in the compiler’s run-time package.
8. What are the two phases of startup sequence?
The startup sequence has two phases: a hardware phase and a software phase. When