flat assembler
Message board for the users of flat assembler.
Index
> Main > fasm doesn't handle repe cmps instruction? |
Author |
|
LocoDelAssembly 24 Nov 2007, 03:17
Because you can only use ESI as dest and EDI as source.
TFM wrote: cmps subtracts the destination string element from the source string element and updates the flags AF, SF, PF, CF and OF, but it does not change any of the compared elements. If the string elements are equal, ZF is set, otherwise it is cleared. The first operand for this instruction should be the source string element addressed by SI or ESI with any segment prefix, the second operand should be the destination string element addressed by DI or EDI. In your case rep cmps word [esi], [edi] or just rep cmpsw will suffice |
|||
24 Nov 2007, 03:17 |
|
AlexP 24 Nov 2007, 03:19
Yes, but I wanted to use repe (repeat if equal) so that if it breaks and the zero flag is not set, then I know the four dwords are not equal. So should I just use rep cmps dword [esi],[edi]? By the way, it is still giving me an invalid address error.. I'll check my code over, but it shouldn't be saying that..
|
|||
24 Nov 2007, 03:19 |
|
LocoDelAssembly 24 Nov 2007, 03:47
I use "repe cmps dword [esi],[edi]" here and works OK, perhaps the error is somewhere else (also)?
Code: virtual at 0 rep repe load a byte from $-2 load b byte from $-1 if a = b display "same opcode!!", 13, 10 end if end virtual ; Guess what it prints Sorry though, it was a misspelling using REP instead of REPE and after reading I couldn't see it because I saw that it was correctly written for the purpose you wanted even though it was a little "obfuscated". |
|||
24 Nov 2007, 03:47 |
|
AlexP 24 Nov 2007, 04:01
...Okay.. thanks for the little opcode demonstration, I think it's in my memory handling. I'll try to find out what is causing the "invalid address" message. Fasm error handling should be able to point out which address or specific opcode has the issue in the future. THanks!
|
|||
24 Nov 2007, 04:01 |
|
LocoDelAssembly 24 Nov 2007, 04:31
But it does! It tell you which line of code is problematic, at least with FASMW.
|
|||
24 Nov 2007, 04:31 |
|
AlexP 24 Nov 2007, 17:11
Yeah, which line of code, but I'm saying which operand has the problem.. Or better yet, fasm should print out a paragraph saying what the problem was, where it happened, what I could've done to fix it, and whether to have one or two sugars in my morning coffee lol... I'm just gonna have to set the file pointer and read in those bytes manually instead of from the GIANT data structure I had. Great....
|
|||
24 Nov 2007, 17:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.