You are here : assembly8086CMPSW

CMPSW - 8086

Compare words: ES:[DI] from DS:[SI].

Algorithm :

  • DS:[SI]-ES:[DI]
  • Sets flag according to Result : OF,ZF,AF,CF,SF,PF
  • if DF = 1 : SI=SI+2 and DI=DI+2
  • else : SI=SI-2 and DI=DI-2


Syntax

cmpsw


Example

.model small
.data
  s1 db 'hello World'
  s2 db 'hello World'
  ...
  ...
.code
  ...
  ...
  lea si,s1
  lea di,s2
  repne cmpsw
  ...
  ...
  end


Output / Return Value


Limitations


Alternatives / See Also


Reference