answersLogoWhite

0

How segment register are used?

Updated: 10/3/2023
User Avatar

Betharado

Lvl 1
12y ago

Best Answer

The segment register in the 80806/8088 microprocessor contains the base address (divided by 16) of a region of memory. Since the register is 16 bits in size, there are 65,536 possible segment base addresses, ranging from 00000H to FFFF0H, in increments of 00010H.

After address translation at the instruction level, the generated 16 bit offset is added to the selected segment register times 16 to generate a physical address between 00000H and FFFFFH. (If the offset and base go past FFFFFH, they wrap around back to 00000H.) Since the offset is also 16 bits in size, and since the overlap is only 4 bits (times 16), then each 64 kb segment overlaps by 16 bytes.

There are four segment registers; CS, DS, ES, and SS, standing for Code Segment, Data Segment, Extra Segment, and Stack Segment.

CS is used for opcode fetches. DS is used for normal data. ES is used for certain string operations as the destination address. SS is used for stack and frame (BP) data.

The segment registers can be implicitly selected by context, or they can be explicitly selected with a segment prefix opcode.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

The segment register contains the base address, divided by 16, of the 64KB segment of memory that the operands lie within.

There are four segment registers, code segment (CS), data segment (DS), stack segment (SS), and extra segment (ES). Unless there is a segment override prefix, the segment chose will be based on context, i.e. code for code, data for operands, stack for stack, and extra for string destinations.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How segment register are used?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the different types of segment register?

The code segment (CS) register is used for access to program code. The data segment (DS) register is used for access to data. The extra segment (ES) register is used for access to data during certain string primitive operations. The stack segment (SS) register is used for access to stack data.Any of these implied uses can be overridden with a segment override prefix opcode.


What is segment address?

A segment address is the contents of a segment register, CS, DS, ES, or SS. It is used after effective address generation to provide an offset in physical memory, by multiplying the segment register by 16 and then adding it to the effective address, giving a 20 bit address. This gives you addressability to 65536 segments of 65536 bytes, each separated by 16 bytes. The register used is usually implicit based on use; CS for code, DS for data, ES for certain string operations, and SS for stack. A segment override prefix can be used to select a different segment register.


What are the function of segment register?

The segment register in the 8086/8088 provide a base address for any memory access. There are four segment registers, CS - Code Segment, DS - Data Segment, SS - Stack Segment, and ES - Extra Segment. Each in used in the context of a particular instruction and contains the base address of the memory segment divided by 16. This allows the processor to access up to 1 MB of memory, though only in segments of 64 KB at a time.


How many register are located in 8088microprocessor?

there are 14 registers in 8088 micro processor. All the 14 are 16 bit registers. They are4 segment registers viz - code segment register, stack segment register, data segment register, extra segment register.general registers are - accumulator register i.e. AX, base register i.e. BX, count register i.e. CX, data register i.e. DX and stack pointer (SP), base pointer (BP).index registers are - source index(SI), destination index(DI),and the other registers are instruction pointer and flags register.


Give the segment registers and their corresponding offset registers?

Give the effective address if the segment register is AA03 and the offset register is 0200.


How the Memory Management Unit converts the logical addresses to physical addresses?

In the 8086/8088, the logical address corresponds to a segment register, such as CS (Code Segment), DS (Data Segment), SS (Stack Segment) and ES (Extra Segment). The segment register is selected by context, or it is explicitly selected using a segment override prefix. The segment register is left shifted 4 bits into a 20-bit temporary register. This is the same as multiplying it by 16. Then the logical address is added to that result. The final result is the physical address.


What are index register and segment register?

A segment register is a register that contains the base address, or something related to the base address, of a region of memory. In the 8086/8088, the four segment registers are multiplied by 16 and added to the effective address to form the physical address. An index register, on the other hand, is a register that contains an address that is added to another address to form the effective address. In the 8086/8088, four address components are involved; 1.) the displacement contained within the instruction, often called the offset, 2.) a base address specified by the r/m field, often the BP or BX register, 3.) an index address specified by the r/m field, often the SI or DI register, and 4.) the segment address specified by context or by a segment override prefix, often the CS, DS, SS, or ES register.


Why cant' a segment register be used as a byte register?

There are only a certain (few) number of operations that you can perform on a segment register. Specifically, you can push/pop, and move. That's it. Besides, arbitrarily manipulating segment registers will impact your execution environment - think about what could happen to your program if you changed CS - bad, very bad, unless you also changed IP - and that is called a far jump.


Which register can be changed directly using pop instruction in 8086?

stack segment register


What registers is used to keep track of address of the memory location where the next instruction is located?

Instruction pointer (IP) is used to hold the offset of the next instruction to be fetched for BIU available from Code Segment whose base address is held in CS segment base register..


A Explain the use of Code Segment CS and data segment DS register in 8086 microprocessor?

Code segment (CS) is a 16-bit register containing address of 64 KB segment with processor instructions. The processor uses CS segment for all accesses to instructions referenced by instruction pointer (IP) register. CS register cannot be changed directly. The CS register is automatically updated during far jump, far call and far return instructions. Data segment (DS) is a 16-bit register containing address of 64KB segment with program data. By default, the processor assumes that all data referenced by general registers (AX, BX, CX, DX) and index register (SI, DI) is located in the data segment. DS register can be changed directly using POP and LDS instructions. Code segment (CS) is a 16-bit register containing address of 64 KB segment with processor instructions. The processor uses CS segment for all accesses to instructions referenced by instruction pointer (IP) register. CS register cannot be changed directly. The CS register is automatically updated during far jump, far call and far return instructions. Data segment (DS) is a 16-bit register containing address of 64KB segment with program data. By default, the processor assumes that all data referenced by general registers (AX, BX, CX, DX) and index register (SI, DI) is located in the data segment. DS register can be changed directly using POP and LDS instructions.


Explain about segment registers in 8086MP?

There are four segment registers in the 8086/8088 processor, CS, DS, ES, and SS, also known as Code Segment, Data Segment, Extra Segment, and Stack Segment. Any time an address is generated by the processor, it is added to the value of one of the segment registers, after that segment register is effectively multiplied by 16, or left shifted four bits, in order to generate the physical address that accesses memory. This gives an effective address range of 20 bits, or 1mb, but note that only 64kb is addressable through any segment register at one time, unless you stop to change the contents of that segment register. This is known as a segmented architecture. By default, the CS register is used when fetching instructions, the DS register is used when accessing data, the SS register is used when accessing the stack, and the ES register is used during certain string type instructions. If desired, an instruction prefix can be used to override, such as forcing use of CS instead of DS when using a table contained within opcode space.