ia-32_volume1_basic-arch

Operand length scasb scan byte string scasw scan word

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and the repeat prefixes (REP) are used to repeat the instructions to implement block moves. The assembler recognizes the following alternate mnemonics for these instructions: INSB (input byte), INSW (input word), and INSD (input doubleword), and OUTB (output byte), OUTW (output word), and OUTD (output doubleword). The INS and OUTS instructions use an address in the DX register to specify the I/O port to be read or written to. 7.3.12 I/O Instructions in 64-Bit Mode For I/O instructions to and from memory, the differences in 64-bit mode are: The source operand is specified by RSI or DS:ESI, depending on the address size attribute of the operation. The destination operand is specified by RDI or DS:EDI, depending on the address size attribute of the operation. Operation on 64-bit data is not encodable and REX prefixes are silently ignored. 7.3.13 Enter and Leave Instructions The ENTER and LEAVE instructions provide machine-language support for procedure calls in block-structured languages, such as C and Pascal. These instructions and the call and return mechanism that they support are described in detail in Section 6.5, "Procedure Calls for Block-Structured Languages". 7.3.14 Flag Control (EFLAG) Instructions The Flag Control (EFLAG) instructions allow the state of selected flags in the EFLAGS register to be read or modified. For the purpose of this discussion, these instructions are further divided subordinate subgroups of instructions that manipulate: Carry and direction flags The EFLAGS register Interrupt flags 7.3.14.1 Carry and Direction Flag Instructions The STC (set carry flag), CLC (clear carry flag), and CMC (complement carry flag) instructions allow the CF flags in the EFLAGS register to be modified directly. They are typically used to initialize the CF flag to a known state before an instruction that 7-28 Vol. 1 PROGRAMMING WITH GENERAL-PURPOSE INSTRUCTIONS uses the flag in an operation is executed. They are also used in conjunction with the rotate-with-carry instructions (RCL and RCR). The STD (set direction flag) and CLD (clear direction flag) instructions allow the DF flag in the EFLAGS register to be modified directly. The DF flag determines the direction in which index registers ESI and EDI are stepped when executing string processing instructions. If the DF flag is clear, the index registers are incremented after each iteration of a string instruction; if the DF flag is set, the registers are decremented. 7.3.14.2 EFLAGS Transfer Instructions The EFLAGS transfer instructions allow groups of flags in the EFLAGS register to be copied to a register or memory or be loaded from a register or memory. The LAHF (load AH from flags) and SAHF (store AH into flags) instructions operate on five of the EFLAGS status flags (SF, ZF, AF, PF, and CF). The LAHF instruction copies the status flags to bits 7, 6, 4, 2, and 0 of the AH register, respectively. The contents of the remaining bits in the register (bits 5, 3, and 1) are undefined, and...
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.

Ask a homework question - tutors are online