Segmented memory
![]() | This article's factual accuracy is disputed. |
You must add a |reason=
parameter to this Cleanup template โ replace it with {{Cleanup|June 2006|reason=<Fill reason here>}}
, or remove the Cleanup template.
Segmented memory is a methodology employed by computer programmers. It is the practice of dividing working memory into blocks. The segments are created initially, but generally can be adjusted in size or number at a later time if needed (different operating systems and compilers may place restrictions on how and when this may be done, however). This practice allows a programmer to have a routine in one segment, a second segment that captures user input, another segment that contains the main program, and so on. The objective of this is to divide programs into logical blocks in memory that reflect their logical structure or function. Segment sizes are variable, but the architecture of the machine usually limits the maximum size of individual segments.
Segmented memory originated with the 8080 processor which used 16-bit addressing and thus had an address space of 64KB. The 8086 processor incorporated the 64KB segment so that 8080 code could easily translate to run on the 8086. There are three types of segments, code for instructions, data for operands, and stack for parameters and temporary values. The 8086 processor allowed for six active memory segments using six registers each of which held the beginning address of the active segment. Addressing in segmented mode was accomplished by a selector:offset pair. The 16-bit selector value is loaded into one of the registers. The contents of the 16-bit register are then multiplied by 16 to give a 20-bit address space. (The contents of the register were left shifted four bits.) The offset is then added to the result giving a linear memory address. The total address space realized was 1MB (1024K).