Saturday 15 October 2016

MIPS : Memory Allocation and Data Alignment

Memory Allocation

Figure 2

  • Based on Figure 2, system based on MIPS processors typically divide memory into three parts:

    1. Text segment :
    - This holds the machine language code for instructions in source file (user                                    program)

    2. Data segment :
    - This holds the data that the program operate on. It is divided into two parts.                                Static data contains data that are statically allocated whose size does not                                      change as the program access them. On top of static data is dynamic                                            data.This data is allocated and deallocated by the programs executes.  

    3. Stack segment :
    - This segment resides at the top of user address space. In a high level                                            language program, local variable and parameters are pushed and popped on                                the stack as the operating system expands and shrink the stack segment                                        toward segment toward the data segment.

Data Alignment
  • Table 1 lists data sizes apply to MIPS chips.


    Table 1

  • Table 2 shows data alignment in MIPS.


    Table 2

0 comments:

Post a Comment