Wednesday, January 30, 2013

Memory Segmentation

A program's memory are divided up into five different segments. The text segments are where the program's assembled machine language instructions are stored. The text segment has read-only permissions. If someone  attempts to write in this segment of memory, the program will terminate. Data and bss segments both store the variables in a program. The data segment stores initialized variables while the bss segment stores unitialized variables. The heap segment is the segment of memory that the programmer can actually control. This segment allows the user to reserve or free memory as he or she sees fit. The fifth segment is the stack segment. This segment temporarily stores local variables when a particular function is called.

No comments:

Post a Comment