1. Test REG/MEM, Reg/MEM/Imm-detection bit command
Affected flag: CF (0), of (0), PF, SF, and ZF
Function: the detection bit Command performs logic and operations on the source and target operands, and sets the flag bit according to the calculation result,Do not saveReturns the source operand, only the flag. After this command is executed, it is usually a conditional transfer command such as JE, JNE, JZ or jnz.
2. Cyclic commands
The execution of cyclic commands itself andNo effectAny flag, with CX or ECx as the counter.
Loop/loopw/loopd label
Loop: Use CX registers instead of ECx registers in real address mode.
Loopw: uses the Cx register as the counter in any mode.
Loopd: ECx registers are used as counters in any mode.
3. Transfer Instructions
Transfer Instruction is an assembly languageProgramA group of commands frequently used by members. In advanced languages, the advice of "do not use transfer statements whenever possible" is often provided. However, if you do not need to use transfer statements in assembly language programs, the program cannot be written, there are not many functions, so in assembly languages, not only transfer commands should be used, but also flexible, because the command system has a large number of transfer commands.
Transfer Instructions are classified into two categories: unconditional transfer instructions and conditional transfer instructions.
Unconditional transfer instruction: Includes JMP Instruction, subprogram call and return, and interrupt call and return.
JMP/REG/MEM
The JMP command is unconditionally transferred from the current place where the program is executed to another place for execution, which can be a short transfer (the offset is within the range of-128 to 127 ), near (near) Transfer (offset within the range of plus and minus 32 K), or far (FAR) Transfer (in differentCodeSegment jump .)
Short transfer and near transfer are only the transfer within the code segment. You only need to import the offset into the stack. For far transfer, you need to import the address and offset of the code segment to be redirected to the stack.
The transfer instruction itself does not affect the flag space.