Wpis z mikrobloga

jak dziala instrukcja cmp w assemblerze (x86)? wiem ze sluzy do porownania rejestru/wartosci/adresu z rejestrem lub adresem pamieci, a potem sa ustawiane odpowiednie flagi ale potrzebuje szerszej informacji, w jaki sposob komputer wie jak ustawic flagi? jakie operacje arytmetyczne i jak wykonuje je komputer zanim ustawi flagi? (bo w taki sposob, to dziala, tak?)
#assembler
  • 5
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach

@goltus: cmp działa przez odejmowanie

Compares the first source operand with the second source operand and sets the status flags in the EFLAGS register according to the results. The comparison is performed by subtracting the second operand from the first operand and then setting the status flags in the same manner as the SUB instruction. When an immediate value is used as an operand, it is sign-extended to the length
  • Odpowiedz