LAHF assembly language instructions and SAHF

LAHF (loaded state flag to AH) AH EFLAGS instruction is copied to the low byte of the register. The flags are copied comprising: sign flag, a zero flag, an auxiliary carry flag, a parity flag and carry flag. Use this instruction, you can easily keep a copy of the flag in a variable:

 

  .data saveflags BYTE .code lahf;? flag to load the AH mov saveflags, ah; save those flag with variables

The SAHF (AH save the contents to a state flag) instruction will be copied to the EFLAGS (or RFLAGS) low byte AH register contents. For example, previously saved values ​​can be retrieved flag variables:

  mov ah, saveflags; load flag is saved to the AH sahf; copied to FLAGS

4.1  Operand Type
4.2  MOV instructions
4.3  MOVZX to doing it and instructions MOVSX
4.4  LAHF SAHF instruction and
4.5 of 5  XCHG instructions
4.6  immediate offset operands
4.7  assembly language data transfer Example
4.8  addition and subtraction Detailed
4.9  the OFFSET operator
4.10  the ALIGN directive
4.11  the PTR operator
4.12  the TYPE operator
4.13  lengthof operator
4.14  the LABEL directive
4.15  indirect addressing
4.16  the JMP and LOOP instruction
4.17  64 MOV instruction
4.18  64-bit addition and subtraction

Guess you like

Origin blog.csdn.net/Javaxuxuexi/article/details/93401446