Describe the different types of segment register.
Segment
Register: A register that points to the base of the current
segment being addressed. Segments are specific areas defined in a program for
containing data, code and stack.
The
6 Segment Registers are:
(i)
Stack Segment (SS). Pointer to the stack
(ii)
Code Segment (CS). Pointer to the code.
(iii)
Data
Segment (DS). Pointer to the data.
(iv)
Extra
Segment (ES). Pointer to extra data ('E' stands for 'Extra').
(v)
F
Segment (FS). Pointer to more extra data (‘F’ comes after 'E').
(vi)
G Segment (GS). Pointer to still more extra data ('G' comes after 'F').
CS
(Code Segment): 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.
Stack
segment (SS): Stack segment is a 16-bit register
containing address of 64KB segment with program stack. By default, the
processor assumes that all data referenced by the Stack pointer (SP) and base
pointer (BP) registers is located in the stack segment. SS register can be
changed directly using POP instruction.
Dam
segment (DS): Data segment 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.
Extra
segment (ES): Extra segment is a 16-bit register containing
address of 64KB segment, usually with program data. By default, the processor
assumes that the DI register references the ES segment in string manipulation
instructions. ES register can be changed directly using POP and LES instructions.
It is possible to change default segments
used by general and index registers by prefixing instructions with a CS, SS, DS
or ES prefix.
IP
(Instruction Pointer): To access instructions the 8086 uses
the registers CS and IP. The CS register contains the segment number of the
next instruction and the IP contains the offset. IP is updated each time an
instruction is executed so that it will point to the next instruction. Unlike
other registers the IP can’t be directly manipulated by an instruction, that is,
an instruction may not contain IP as its operand.
No comments
Dear Members, Thanks for Your Comments. We must be reply your comment answer as soon as possible. Please Stay with us.....