flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound
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. |
|||
![]() |
|
randomdude
i have always seen or eax,-1 and thats what i use as well
|
|||
![]() |
|
l4m2
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 |
|||
![]() |
|
l4m2
Code: mov eax,100 Code: lea eax,[word 100] Code: xor eax,eax mov al,100 |
|||
![]() |
|
randomdude
Code: or dword [ebp-4],-1 Code: mov eax,100 |
|||
![]() |
|
HaHaAnonymous
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. |
|||
![]() |
|
l4m2
HaHaAnonymous wrote:
a = 1000; |
|||
![]() |
|
revolution
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. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.