flat assembler
Message board for the users of flat assembler.
Index
> Main > Fastest way to reset registers? |
Author |
|
Ivan2k2 02 Jun 2006, 09:52
it is strange that MOV is slow for you...
try this: xor eax,eax and eax,0ffffffffh sub eax,eax |
|||
02 Jun 2006, 09:52 |
|
Vasilev Vjacheslav 02 Jun 2006, 10:11
saigon, it's time to use 'search' option
|
|||
02 Jun 2006, 10:11 |
|
saigon 02 Jun 2006, 10:38
@Ivan2k2: I tried all of them, it seems that "XOR eax, eax" is the fastest option. (And, I have too many macros to list and each of them uses MOV, so that's why it's slow)
@Vasilev: It's not time to use the search. I searched the board before posting, but the only thread I found which had good information was http://board.flatassembler.net/topic.php?t=4485 . But I had to ask, because I didn't find the really fastest option. Thanks! |
|||
02 Jun 2006, 10:38 |
|
LocoDelAssembly 02 Jun 2006, 10:49
Ivan2k2 wrote:
That remains EAX untouched |
|||
02 Jun 2006, 10:49 |
|
Ivan2k2 02 Jun 2006, 11:51
oops... of course 'and eax,0'
|
|||
02 Jun 2006, 11:51 |
|
jbojarczuk 21 Jun 2006, 04:53
xor eax , eax is the fastest option on AMD64 because it is the shortest instruction for the task, and allows you to use the instruction cache in a better way. Besides, the register dependency (that made this method actually slower on Athlon XP) was taken out of this operation.
|
|||
21 Jun 2006, 04:53 |
|
vid 21 Jun 2006, 05:15
saigon: how about reading http://board.flatassembler.net/topic.php?t=4816 first?
|
|||
21 Jun 2006, 05:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.