DATA MOVEMENT INSTRUCTIONS:SEGMENT OVERRIDE PREFIX.

SEGMENT OVERRIDE PREFIX

The segment override prefix, which may be added to almost any instruction in any memory- addressing mode, allows the programmer to deviate from the default segment. The segment over- ride prefix is an additional byte that appends the front of an instruction to select an alternate segment register. About the only instructions that cannot be prefixed are the jump and call instructions that must use the code segment register for address generation. The segment override is also used to select the FS and GS segments in the 80386 through the Core2 microprocessors.

For example, the MOV AX,[DI] instruction accesses data within the data segment by default. If required by a program, this can be changed by prefixing the instruction. Suppose that the data are in the extra segment instead of in the data segment. This instruction addresses the extra segment if changed to MOV AX,ES:[DI].

Table 4–21 shows some altered instructions that address different memory segments that are different from normal. Each time an instruction is prefixed with a segment override prefix, the instruction becomes 1 byte longer. Although this is not a serious change to the length of the instruction, it does add to the instruction’s execution time. It is usually customary to limit the use of the segment override prefix and remain in the default segments so that shorter and more efficient software is written.

Leave a comment

Your email address will not be published. Required fields are marked *