flat assembler
Message board for the users of flat assembler.
Index
> Main > which used more |
Author |
|
JohnFound 27 Mar 2015, 06:04
Except the 5 bytes "mov", all these are 3 bytes long, but "or eax, -1" is better because is only one instruction.
But sometimes on initialization I use: Code: xor eax, eax mov [somewhere1], eax dec eax mov [somewhere2], eax The same way, if the CF is already set, SBB can be better. |
|||
27 Mar 2015, 06:04 |
|
randomdude 27 Mar 2015, 11:07
i have always seen or eax,-1 and thats what i use as well
|
|||
27 Mar 2015, 11:07 |
|
l4m2 27 Mar 2015, 13:10
And what about
Code: mov dword[ebp-4],0'ffff'ffffh Code: or eax,-1 mov [ebp-4],eax Code: or dword [ebp-4],-1 |
|||
27 Mar 2015, 13:10 |
|
l4m2 27 Mar 2015, 15:13
Code: mov eax,100 Code: lea eax,[word 100] Code: xor eax,eax mov al,100 |
|||
27 Mar 2015, 15:13 |
|
randomdude 27 Mar 2015, 15:32
Code: or dword [ebp-4],-1 Code: mov eax,100 |
|||
27 Mar 2015, 15:32 |
|
HaHaAnonymous 28 Mar 2015, 00:36
Quote:
Not sure. I remember I used: Code:
xor eax,eax
not eax
But now I just follow the simple way: Code: mov eax,$FFFFFFFF Code: mov eax, dword [_value] _value: dd $FFFFFFFF It works. That is why "mov" exists. |
|||
28 Mar 2015, 00:36 |
|
l4m2 28 Mar 2015, 04:13
HaHaAnonymous wrote:
a = 1000; |
|||
28 Mar 2015, 04:13 |
|
revolution 28 Mar 2015, 04:17
This topic would be much more interesting if it was discussing loading of constants in ARM code before the v7 architecture gave us MOVW and MOVT.
For x86 it is trivial. |
|||
28 Mar 2015, 04:17 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.