flat assembler
Message board for the users of flat assembler.
Index
> Main > mov eax,neg 1000h |
Author |
|
JohnFound 03 Nov 2010, 14:59
ouadji wrote:
Why not simply: Code: mov eax, -1000h Or better: Code: mov eax, -$1000 |
|||
03 Nov 2010, 14:59 |
|
revolution 03 Nov 2010, 15:02
Or even better
Code: mov eax,-0x1000 |
|||
03 Nov 2010, 15:02 |
|
bitRAKE 03 Nov 2010, 15:09
Code: macro mov dest,src { temp equ src match =neg num,src \{ restore temp temp equ -num \} mov dest,num } |
|||
03 Nov 2010, 15:09 |
|
baldr 03 Nov 2010, 15:47
ouadji,
I've seen a = -1*b at least once. ----8<---- bitRAKE, imul dest, src, -1 probably will handle all other flavors of src, then. |
|||
03 Nov 2010, 15:47 |
|
ouadji 03 Nov 2010, 16:06
ok ... i still missed a good opportunity to keep quiet ! imul dest, src, -1 <--- |
|||
03 Nov 2010, 16:06 |
|
revolution 03 Nov 2010, 16:10
baldr wrote: imul dest, src, -1 probably will handle all other flavors of src, then. |
|||
03 Nov 2010, 16:10 |
|
ouadji 03 Nov 2010, 16:15
Quote: Should that be: imul dest, src, neg 1 some recursion ? |
|||
03 Nov 2010, 16:15 |
|
baldr 03 Nov 2010, 17:33
revolution,
Isn't it my turn to be Mr. Hyde? |
|||
03 Nov 2010, 17:33 |
|
revolution 04 Nov 2010, 00:09
ouadji: You can also use this:
Code: neg fix - baldr wrote: Isn't it my turn to be Mr. Hyde? |
|||
04 Nov 2010, 00:09 |
|
bitRAKE 04 Nov 2010, 00:52
Code: macro mov dest,src { temp equ src match =neg num,src \{ restore temp temp equ -num \} mov dest,temp restore temp } He aska for a macro I give 'em a macro. The pattern works for all kinds of domain specific syntax tweaks. "NEG fix -" woo, scary. Actually, it would be trivial to add NEG to FASM's expression calculator. Code: single_operand_operators: db 1,'+',0 db 1,'-',083h db 3,'neg',083h db 3,'not',0D0h db 3,'plt',0E1h db 3,'rva',0E0h db 0 _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
04 Nov 2010, 00:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.