flat assembler
Message board for the users of flat assembler.
Index
> Main > Fibonacci sequence in "2 instructions" |
Author |
|
revolution 25 Aug 2018, 20:55
If REP could be used with arbitrary instructions then we could do this:
Code: rep xadd eax,edx |
|||
25 Aug 2018, 20:55 |
|
rugxulo 26 Aug 2018, 02:05
revolution wrote: If REP could be used with arbitrary instructions ... It can, but it won't do what you think. Older cpus will ignore such prefixes. And it has been used to pair with or extend other instructions. "rep ret" (AMD optimization, replaced by "ret 0" in some later cases) or SSE2's "pause" (aka, "rep nop") or even SSE4's "lzcnt" (which IIRC is just "rep bsr"). (You probably were already aware of this. I don't claim to know all such corner cases.) |
|||
26 Aug 2018, 02:05 |
|
revolution 26 Aug 2018, 04:09
I think that in those cases Intel consider the entire byte sequence to be a single instruction. So it isn't being used as a REP prefix, but instead a reuse of the REP byte to make a new instruction.
It is also possible that in the future the REP XADD byte sequence might but redefined as some new instruction also. |
|||
26 Aug 2018, 04:09 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.