flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Can't multiply some constants

Author
Thread Post new topic Reply to topic
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Code:
   dd ((0EFCDAB89h * 098BADCFEh) and 0FFFFFFFFh)    
Returns 'Error: value out of range'
I guess it's because some changes made recently to avoid infinite loops when preprocessing or something like that, but imho such changes shouldn't stop any programmer from making such calculations as above. Is it a bug or will it stay like this?
Post 29 Jul 2005, 13:47
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7736
Location: Kraków, Poland
Tomasz Grysztar
Read the WHATSNEW.TXT - it's explained there.

For the reason look also here: http://board.flatassembler.net/topic.php?t=3844
The 65-bit storage would need many changes in expression calculator and symbols storage, so for now I've just added the overflow checking to avoid situations when multiplying two positive numbers gives negative result.
Post 29 Jul 2005, 13:52
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17348
Location: In your JS exploiting you and your system
revolution
For that particular calculation you can use this:
Code:
dd ((0ffffffffEFCDAB89h * 0ffffffff98BADCFEh) and 0FFFFFFFFh)    
Since the lower 32 bits of any 32x32 multiply are not affected by pos/neg number signs.
Post 01 Sep 2005, 09:13
View user's profile Send private message Visit poster's website Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Ok, big thanks for the answer revolution. I'll use this method
Post 01 Sep 2005, 20:51
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.