MIPS Memory Allocation
The stack starts at top and grows down towards the data segment.
The program code starts at 0x40000.
The static data starts at 0x1000000. Dynamic data (data allocated by new) starts right after it.
The $gp is situated to make it easy to access the static data.