flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > macro neg ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1938
Roman 09 May 2025, 02:29
fasmw 1.73 have neg for macro ?
Code:

v = -1
b = neg v ;=1
    
Post 09 May 2025, 02:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20625
Location: In your JS exploiting you and your system
revolution 09 May 2025, 02:49
Code:
b = -v    
Post 09 May 2025, 02:49
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1938
Roman 09 May 2025, 02:58
I do.
b = not (v)+1

This variant correct?
Post 09 May 2025, 02:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20625
Location: In your JS exploiting you and your system
revolution 09 May 2025, 04:48
If v is an EQU then use:
Code:
b = -(v)    
Post 09 May 2025, 04:48
View user's profile Send private message Visit poster's website Reply with quote
a



Joined: 10 Apr 2025
Posts: 17
Location: Ukraine
a 09 May 2025, 23:15
This code does work:
Code:
mov eax, not 1    
However, this one does not:
Code:
a = not 1    

Apparently, this feature is undocumented. I wonder how many more hidden features fasm has, it would be nice if someone would make a list of undocumented features.
Post 09 May 2025, 23:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20625
Location: In your JS exploiting you and your system
revolution 10 May 2025, 00:28
What do you mean by "does not work"?
Code:
mov eax, not 1
a = not 1
db a
dw a
dd a
dq a

$ fasm test.asm 
flat assembler  version 1.73.31  (16384 kilobytes memory)
1 passes, 21 bytes.

$ hd test.bin 
00000000  66 b8 fe ff ff ff fe fe  ff fe ff ff ff fe ff ff  |f...............|
00000010  ff ff ff ff ff                                    |.....|
00000015    
Post 10 May 2025, 00:28
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.