Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the type and function of the computer mid-segment register?

Shulou Source: shulou.com Published: 2022-06-02 14:40:19 10月05日 Update

This article mainly introduces the type and function of the computer middle register, which is very detailed and has a certain reference value. Interested friends must finish reading it!

The segment register is set because of the segmented management of memory. The computer needs to segment memory to be allocated to different programs (similar to hard disk paging). When describing memory segmentation, you need the following information: 1. The size of the segment; 2. The starting address of the segment; 3. Administrative attributes of the section (write prohibited / execution prohibited / system specific, etc.). This information needs to be stored in 8 bytes (64 bits), but the segment register has only 16 bits, so the segment number (segment selector) can only be stored in the segment register, and then mapped to GDT (global (segment) descriptor table) in memory to read the segment information.

Segment register: in the 8086 system, the address code for accessing memory consists of two parts: the segment address and the intra-segment offset address. Segment registers are used to store the logical base values of each segment and indicate the four logical segments currently in use, including code segment register CS, stack segment register SS, data segment register DS and additional segment data register ES.

Types and functions:

1. Code snippet register CS (Code Segment)

The base address of the segment in which the program code is currently running is stored, indicating that the currently used instruction code can be obtained from the memory segment specified in the register, and the corresponding offset is provided by IP.

2. Data segment register DS (Data Segment)

Indicates the lowest address of the segment where the data used by the current program is stored, that is, the base address of the segment where the segment is stored.

3. Stack segment register SS (Stack Segment)

Indicates the bottom address of the current stack, that is, the segment base address where the stack segment is stored.

4. Additional segment register ES (Extra Segment)

These are all the contents of this article entitled "what are the types and functions of computer registers?" Thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Register address data code stack storage function type computer information base address program memory content memory internal current article system logic Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Redmi Shulou Information OPPO Reno