flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound
ouadji wrote:
Why not simply: Code: mov eax, -1000h Or better: Code: mov eax, -$1000 |
|||
![]() |
|
revolution
Or even better
![]() Code: mov eax,-0x1000 |
|||
![]() |
|
bitRAKE
Code: macro mov dest,src { temp equ src match =neg num,src \{ restore temp temp equ -num \} mov dest,num } ![]() |
|||
![]() |
|
baldr
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
ok ... i still missed a good opportunity to keep quiet ! ![]() ![]() imul dest, src, -1 <--- ![]() |
|||
![]() |
|
revolution
baldr wrote: imul dest, src, -1 probably will handle all other flavors of src, then. ![]() |
|||
![]() |
|
ouadji
Quote: Should that be: imul dest, src, neg 1 some recursion ? ![]() ![]() |
|||
![]() |
|
baldr
revolution,
Isn't it my turn to be Mr. Hyde? ![]() |
|||
![]() |
|
revolution
ouadji: You can also use this:
Code: neg fix - baldr wrote: Isn't it my turn to be Mr. Hyde? |
|||
![]() |
|
bitRAKE
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 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.