Page 1 of 1

REPE and CMPS

Posted: Fri Dec 28, 2007 4:35 pm
by matias_beretta
Hello, thanks for reading my topic...

I was reading the FASM manual and found this:

repe cmpsb ;COMPARE [ES:DI] and [DS:SI] until CX = 0

but can i use this???????????:

repe cmps byte [ds:si], [ds:di]

bye :)

Posted: Fri Dec 28, 2007 5:27 pm
by Masterkiller
According to the Intel Instruction Set the instruction is:

Code: Select all

CMPS byte ptr ES:[DI], byte ptr DS:[SI] ; or CMPSB
CMPS word ptr ES:[DI], word ptr DS:[SI] ; or CMPSW
No way to use other operands. This is integrated in processor architecture.

reply

Posted: Fri Dec 28, 2007 7:29 pm
by matias_beretta
thanks :)

Posted: Sat Dec 29, 2007 6:57 pm
by XCHG
You can simply put:

Code: Select all

  REPE    CMPSB
Those operands are optional.

Posted: Sun Dec 30, 2007 10:17 am
by Red Shaya
you could

Code: Select all

    PUSH DS
    POP  ES
    REPE CMPSB
:-)