flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
baldr
killasmurf86,
Both manuals explicitly state that only rep prefix (which has the same opcode as repe/repz) can be used with movs. This is understandable: even if source isn't equal to destination before the instruction is executed, it will be after. ![]() |
|||
![]() |
|
killasmurf86
Thanks for clearing my doubt's.... I finally fixed bug, after I posted.....
I just wanted to verify.... cause I was staring at the code for hours, and just couldn't understand why It doesn't work... ![]() |
|||
![]() |
|
MazeGen
movs doesn't change flags and both REPE and REPNE is clever enough not to check for them.
Therefore repne movs works the same like rep movs. And rep movs is the same like repe movs in machine code. |
|||
![]() |
|
ouadji
100% agree with MazeGen there is no comparison in "movs. "REPNE" has no meaning here. |
|||
![]() |
|
revolution
MazeGen wrote: movs doesn't change flags and both REPE and REPNE is clever enough not to check for them. |
|||
![]() |
|
ouadji
Quote:
not a matter of useless behavior of the processor. make a comparison after a "mov" is an absurdity, or then, it's not a "mov", but a "mov_and_cmp". Last edited by ouadji on 05 Oct 2010, 11:12; edited 1 time in total |
|||
![]() |
|
revolution
ouadji wrote: it's a matter of logique (of the code), |
|||
![]() |
|
ouadji
100% agree with you revolution that's what I tried to say ... ( ![]() the code should be logical, (reliability and dependability in one's code) and never use any useless behavior (unexpected) of the processor. |
|||
![]() |
|
edfed
the best way to have a reliable code for X86 is to code with 386 instruction set only
![]() the best way to have a fast code is to code with X86 RISC instructions, and better, code with single byte, parallelisable in Pentium, and low latency, instructions only. |
|||
![]() |
|
MazeGen
It seems that I accidentally deleted the disclamer part: "undocumented, you should't rely on it".
However, the difference between REP and REPE is made by the repeated instruction: if the instruction changes flags, REP/REPE tests them, otherwise it doesn't test them at all. It is very likely that the same behaviour is hardwired in REPNE prefix. |
|||
![]() |
|
edfed
from HELPPC:
REP repeat a string instruction unti CX=0 REPE/REPZ repeat until CX=0 and Zero flag is set REPNE/REPNZ repeat until CX=0 and Zero flag is clear http://docs.huihoo.com/help-pc/asm-rep.html |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.