flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > x dd 10^9 |
Author |
|
Teehee 02 May 2011, 18:49
+1
|
|||
02 May 2011, 18:49 |
|
Enko 02 May 2011, 20:21
As I see it, overriding the DD instruction with a macro will be enough.
|
|||
02 May 2011, 20:21 |
|
vid 02 May 2011, 21:15
10e9 works fine for me
|
|||
02 May 2011, 21:15 |
|
Madis731 03 May 2011, 07:49
How about a workaround:
Code: dd 1'000'000'000 ; 10^9 dd 10e9 ; 1.0*10^9 - float only dd 2 shl 3 ; 2^4 Sorry, a typo! Last edited by Madis731 on 03 May 2011, 11:34; edited 1 time in total |
|||
03 May 2011, 07:49 |
|
ouadji 03 May 2011, 10:29
Code: dq 1000000000 ;does compile ;but it has nothing to do with dq 10e9 ; does compile to define a "float", the "dot" is enough. The "e" are available to add an "exponent" operator. And do not tell me to use a macro, this is not a real solution. "Just a plaster on a wooden leg" ... like we say in French. (2^4 = 2 shl 3 ) |
|||
03 May 2011, 10:29 |
|
Madis731 03 May 2011, 11:46
A lot of things are macros in FASM. Take a look at the include\macro folder.
There are good and bad macros even some *elegant* ones but you cannot say that a macro is not a solution. Macros are meant to make life easier. You want your reading experience to be easier, but FASM provides all the functionality. This is something that is best fitted job for macros. not everything must be in "The Kernel" |
|||
03 May 2011, 11:46 |
|
vid 03 May 2011, 12:07
So in your first post, you was trying to store 1e10 integer in a dword?
|
|||
03 May 2011, 12:07 |
|
Madis731 03 May 2011, 13:53
I think it fits, doesn't it!? Don't confuse me
1e9 = 1*10^9 = 1000000000 = 1 billion signed max is 2147483647 unsigned 4294967295 1e10 does NOT fit! |
|||
03 May 2011, 13:53 |
|
ouadji 03 May 2011, 14:03
Quote: Macros are meant to make life easier. |
|||
03 May 2011, 14:03 |
|
vid 03 May 2011, 14:20
Madis731 wrote: I think it fits, doesn't it!? Don't confuse me Carefully reread first post of the topic He wrote "dd 10e9", that's why I thought he must mean float, not integer. |
|||
03 May 2011, 14:20 |
|
ouadji 03 May 2011, 14:30
it was just an example... if fasm had included a exponent operator. dd 10^9 == dd 10e9 == 1'000'000'000 ;0x3B9ACA00 |
|||
03 May 2011, 14:30 |
|
edfed 10 May 2011, 11:41
be able to do that is more interresting than just 10^9 in my opinion:
Code: value = 4.543 integer =43245 dd 1.0*0.0032/value+56-integer mix int and float values in numerical expressions and let use multiple floats in expressions, if a float is in, then, result is in float. this feature i think cannot be implemented easy just with a macro, i think it can be simpler to implement it in the "kernel", fasm2.x? but exponent ^ too can be a very good feature, as i can see, 10e9 is accepted, but not 10^9. it is not very important, but can be very cool. about numerical expressions, implement cos, sin, tan, sqrt, ², etc can be very cool too. but not needed for now. |
|||
10 May 2011, 11:41 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.