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