flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 03 Nov 2010, 14:59
ouadji wrote:
Why not simply: Code: mov eax, -1000h Or better: Code: mov eax, -$1000 |
|||
![]() |
|
revolution 03 Nov 2010, 15:02
Or even better
![]() Code: mov eax,-0x1000 |
|||
![]() |
|
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 } ![]() |
|||
![]() |
|
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. ![]() |
|||
![]() |
|
ouadji 03 Nov 2010, 16:06
ok ... i still missed a good opportunity to keep quiet ! ![]() ![]() imul dest, src, -1 <--- ![]() |
|||
![]() |
|
revolution 03 Nov 2010, 16:10
baldr wrote: imul dest, src, -1 probably will handle all other flavors of src, then. ![]() |
|||
![]() |
|
ouadji 03 Nov 2010, 16:15
Quote: Should that be: imul dest, src, neg 1 some recursion ? ![]() ![]() |
|||
![]() |
|
baldr 03 Nov 2010, 17:33
revolution,
Isn't it my turn to be Mr. Hyde? ![]() |
|||
![]() |
|
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? |
|||
![]() |
|
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 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.