REPE and CMPS

Programming, for all ages and all languages.
Post Reply
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

REPE and CMPS

Post 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 :)
Matías Beretta
User avatar
Masterkiller
Member
Member
Posts: 153
Joined: Sat May 05, 2007 6:20 pm

Post 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.
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

reply

Post by matias_beretta »

thanks :)
Matías Beretta
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

You can simply put:

Code: Select all

  REPE    CMPSB
Those operands are optional.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
User avatar
Red Shaya
Posts: 15
Joined: Wed Oct 03, 2007 4:21 pm
Contact:

Post by Red Shaya »

you could

Code: Select all

    PUSH DS
    POP  ES
    REPE CMPSB
:-)
The Bina OS - More of a challenge then an OS
The Eddie OS - OS for kids and for fun loving adults
Post Reply