달력

12

« 2024/12 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2010. 2. 6. 15:19

CMP(비교) 명령문 자료실2010. 2. 6. 15:19


CMP - 비교문

        사용법:  CMP     dest,src
        수정하는 플래그: AF CF OF PF SF ZF

         source(소스)를 destination(데스티네이션)에서 빼고, 플래그를 갱신한다.
         하지만 결과를 저장하지는 않는다. 플래그는 그 이후에도 컨디션을 위해 체크될 수 있다.

                                 클럭                   바이트
        오퍼랜드         808x  286   386   486          용량
        reg,reg           3     2     2     1             2

        mem,reg          9+EA   7     5     2            2-4  (W88=13+EA)
        reg,mem          9+EA   6     6     2            2-4  (W88=13+EA)
        reg,immed         4     3     2     1            3-4
        mem,immed       10+EA   6     5     2            3-6  (W88=14+EA)

        accum,immed       4     3     2     1            2-3

        3C ib CMP AL, imm8 Compare imm8 with AL
        3D iw CMP AX, imm16 Compare imm16 with AX
        3D id CMP EAX, imm32 Compare imm32 with EAX
        80 /7 ib CMP r/m8, imm8 Compare imm8 with r/m8
        81 /7 iw CMP r/m16, imm16 Compare imm16 with r/m16

        81 /7 id CMP r/m32,imm32 Compare imm32 with r/m32
        83 /7 ib CMP r/m16,imm8 Compare imm8 with r/m16
        83 /7 ib CMP r/m32,imm8 Compare imm8 with r/m32
        38 / r CMP r/m8,r8 Compare r8 with r/m8
        39 / r CMP r/m16,r16 Compare r16 with r/m16

        39 / r CMP r/m32,r32 Compare r32 with r/m32
        3A / r CMP r8,r/m8 Compare r/m8 with r8
        3B / r CMP r16,r/m16 Compare r/m16 with r16
        3B / r CMP r32,r/m32 Compare r/m32 with r32
:
Posted by 해토머리