Unformatted text preview: rating system or executive is using the segmented or the real-address mode memory model. For the purpose of this discussion, these instructions are divided subordinate subgroups of instructions that allow: Segment-register load and store Far control transfers Software interrupt calls Handling of far pointers 184.108.40.206 Segment-Register Load and Store Instructions The MOV instruction (introduced in Section 220.127.116.11, "General Data Movement Instructions") and the PUSH and POP instructions (introduced in Section 18.104.22.168, "Stack Manipulation Instructions") can transfer 16-bit segment selectors to and from 7-30 Vol. 1 PROGRAMMING WITH GENERAL-PURPOSE INSTRUCTIONS segment registers (DS, ES, FS, GS, and SS). The transfers are always made to or from a segment register and a general-purpose register or memory. Transfers between segment registers are not supported. The POP and MOV instructions cannot place a value in the CS register. Only the far control-transfer versions of the JMP, CALL, and RET instructions (see Section 22.214.171.124, "Far Control Transfer Instructions") affect the CS register directly. 126.96.36.199 Far Control Transfer Instructions The JMP and CALL instructions (see Section 7.3.8, "Control Transfer Instructions") both accept a far pointer as a source operand to transfer program control to a segment other than the segment currently being pointed to by the CS register. When a far call is made with the CALL instruction, the current values of the EIP and CS registers are both pushed on the stack. The RET instruction (see "Call and return instructions" on page 7-21) can be used to execute a far return. Here, program control is transferred from a code segment that contains a called procedure back to the code segment that contained the calling procedure. The RET instruction restores the values of the CS and EIP registers for the calling procedure from the stack. 188.8.131.52 Software Interrupt Instructions The software interrupt instructions INT, INTO, BOUND, and IRET (see Section 184.108.40.206, "Software Interrupt Instructions") can also call and return from interrupt and exception handler procedures that are located in a code segment other than the current code segment. With these instructions, however, the switching of code segments is handled transparently from the application program. 220.127.116.11 Load Far Pointer Instructions The load far pointer instructions LDS (load far pointer using DS), LES (load far pointer using ES), LFS (load far pointer using FS), LGS (load far pointer using GS), and LSS (load far pointer using SS) load a far pointer from memory into a segment register and a general-purpose general register. The segment selector part of the far pointer is loaded into the selected segment register and the offset is loaded into the selected general-purpose register. 7.3.17 Miscellaneous Instructions The following instructions perform operations that are of interest to applications programmers. For the purpose...
View Full Document
- Winter '11
- X86, Intel corporation, 64-bit mode, fpu floating-point exception, FPU Control Instructions