Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
back2root:ibm-pc-ms-dos:instr:cmp [2023/02/24 14:16] – supprimée - modification externe (Unknown date) 127.0.0.1 | back2root:ibm-pc-ms-dos:instr:cmp [2023/03/03 23:53] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== CMP - CMPS - CMPSB - CMPSD - CMPSW - CMPSCHG ====== | ||
+ | |||
+ | ===== CMP - Compare ===== | ||
+ | |||
+ | Subtracts source from destination and updates the flags but does not save result. Flags can subsequently be checked for conditions. | ||
+ | |||
+ | **Usage:** | ||
+ | <code asm> | ||
+ | CMP dest, | ||
+ | </ | ||
+ | |||
+ | **Modifies flags: | ||
+ | |||
+ | <WRAP round box> | ||
+ | CF PF AF ZF SF OF | ||
+ | </ | ||
+ | |||
+ | ^ ^ Clocks | ||
+ | ^ Operands | ||
+ | | reg, | ||
+ | | mem, | ||
+ | | reg, | ||
+ | | reg, | ||
+ | | mem, | ||
+ | | accum, | ||
+ | |||
+ | ===== CMPSx - Compare String (Byte,Word, Dword) ===== | ||
+ | |||
+ | Subtracts destination value from source without saving results. Updates flags based on the subtraction and the index registers (E)SI and (E)DI are incremented or decremented depending on the state of the Direction Flag. CMPSB inc/ | ||
+ | |||
+ | **Usage:** | ||
+ | <code asm> | ||
+ | CMPS dest, | ||
+ | CMPSB dest, | ||
+ | CMPSW dest, | ||
+ | CMPSD dest, | ||
+ | </ | ||
+ | |||
+ | **Modifies flags: | ||
+ | |||
+ | <WRAP round box> | ||
+ | CF PF AF ZF SF OF | ||
+ | </ | ||
+ | |||
+ | ^ ^ Clocks | ||
+ | ^ Operands | ||
+ | | dest, | ||
+ | |||
+ | ===== CMPSXCHG - Compare and Exchange ===== | ||
+ | |||
+ | Compares the accumulator (8-32 bits) with " | ||
+ | |||
+ | **Usage:** | ||
+ | <code asm> | ||
+ | CMPXCHG dest, | ||
+ | </ | ||
+ | |||
+ | **Modifies flags: | ||
+ | |||
+ | <WRAP round box> | ||
+ | CF PF AF ZF SF OF | ||
+ | </ | ||
+ | |||
+ | ^ ^ Clocks | ||
+ | ^ Operands | ||
+ | | reg, | ||
+ | | reg, | ||
+ | |||
+ | {{page> | ||