X86 Memory Segmentation > 온라인상담

온라인상담

글로벌드림다문화연구소에 오신걸 환영합니다
온라인상담

X86 Memory Segmentation

페이지 정보

작성자 Krystle Streete… 작성일25-10-29 07:19 조회6회 댓글0건

본문

The x86 structure has supported memory segmentation since the original Intel 8086 (1978), however x86 memory segmentation is a plainly descriptive retronym. Sixty four KB of memory (16,384 or 65,536 bytes), and whose directions and registers had been optimised for the latter. Dealing with bigger addresses and extra memory was thus comparably slower, as that capability was somewhat grafted-on within the Intel 8086. Memory Wave Protocol segmentation may keep programs compatible, relocatable in memory, and by confining significant elements of a program's operation to 64 KB segments, the program could nonetheless run quicker. In 1982, the Intel 80286 added assist for virtual memory and memory protection; the original mode was renamed actual mode, and the brand new model was named protected mode. The x86-64 structure, launched in 2003, Memory Wave has largely dropped support for segmentation in 64-bit mode. In both real and protected modes, the system makes use of 16-bit segment registers to derive the actual memory tackle. In actual mode, the registers CS, DS, SS, and ES level to the currently used program code section (CS), the current knowledge segment (DS), the current stack section (SS), and one extra phase decided by the system programmer (ES).



The Intel 80386, launched in 1985, provides two extra section registers, FS and GS, with no particular makes use of defined by the hardware. The way in which during which the section registers are used differs between the 2 modes. The choice of segment is generally defaulted by the processor in accordance with the operate being executed. Directions are all the time fetched from the code segment. Any information reference to the stack, including any stack push or pop, makes use of the stack segment; knowledge references indirected through the BP register sometimes consult with the stack and so that they default to the stack segment. The additional section is the mandatory destination for string operations (for example MOVS or CMPS); for this one function only, the mechanically chosen segment register cannot be overridden. All other references to data use the information segment by default. The info phase is the default source for string operations, but it can be overridden. FS and GS don't have any hardware-assigned makes use of. The instruction format allows an elective section prefix byte which can be used to override the default segment for chosen directions if desired.



In real mode or V86 mode, the basic size of a phase is 65,536 bytes, with particular person bytes being addressed utilizing 16-bit offsets. The 16-bit segment selector in the section register is interpreted as the most significant sixteen bits of a linear 20-bit deal with, referred to as a segment handle, of which the remaining four least significant bits are all zeros. The segment address is all the time added to a 16-bit offset in the instruction to yield a linear address, Memory Wave which is the same as bodily address in this mode. The main zeros of the linear tackle, segmented addresses, and the section and offset fields are shown here for readability. 4096 distinct segment:offset pairs. For instance, the linear deal with 08124h can have the segmented addresses 06EFh:1234h, 0812h:0004h, 0000h:8124h, and so on. This might be confusing to programmers accustomed to distinctive addressing schemes, nevertheless it can be used to benefit, for example when addressing a number of nested knowledge constructions.



Whereas real mode segments are technically all the time 64 KB long, the practical effect is simply that no section will be longer than sixty four KB, rather than that each segment as really utilized in a program must be treated as sixty four KB lengthy - coping with successfully smaller segments is possible: usable sizes vary from sixteen by way of 65,536 bytes, in 16-byte steps. As a result of there isn't a safety or privilege limitation in actual mode, it continues to be totally up to this system to coordinate and keep within the bounds of any segments. This is true each when a segment is programmatically treated as smaller than, or the complete 64 KB, however it is usually true that any program can all the time entry any memory by just changing segments, since it could arbitrarily set phase selectors to alter phase addresses with completely no supervision. Due to this fact, while real mode could be considered allowing completely different segment lengths, and as allowing segments to be overlapping or non-overlapping as desired, none of that is restrictively enforced by the CPU.



The effective 20-bit address area of Laptop/XT-era CPUs limits the addressable memory to 220 bytes, or 1,048,576 bytes (1 MB). This derived instantly from the hardware design of the Intel 8086 (and, subsequently, the intently related 8088), which had precisely 20 deal with pins. That's, at 16 byte intervals. Since all segments are technically 64 KB long, this explains how overlap can occur between segments and why any location in the linear memory address area might be accessed with many segment:offset pairs. The precise location of the beginning of a phase in the linear deal with area could be calculated with section × 16. Such deal with translations are carried out by the segmentation unit of the CPU. The last phase, FFFFh (65535), begins at linear handle FFFF0h (1048560), sixteen bytes before the top of the 20-bit address area, and thus can access, with an offset of up to 65,536 bytes, as much as 65,520 (65536−16) bytes previous the tip of the 20-bit handle area of the 8086 or 8088 CPU.

댓글목록

등록된 댓글이 없습니다.