This preview shows page 1. Sign up to view the full content.
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 18.104.22.168 Segment-Register Load and Store Instructions The MOV instruction (introduced in Section 22.214.171.124, "General Data Movement Instructions") and the PUSH and POP instructions (introduced in Section 126.96.36.199, "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 188.8.131.52, "Far Control Transfer Instructions") affect the CS register directly. 184.108.40.206 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. 220.127.116.11 Software Interrupt Instructions The software interrupt instructions INT, INTO, BOUND, and IRET (see Section 18.104.22.168, "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. 22.214.171.124 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
This note was uploaded on 10/01/2013 for the course CPE 103 taught by Professor Watlins during the Winter '11 term at Mississippi State.
- Winter '11