flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > equ to float value.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1080
Roman
Fasmw 1.73
I want get float value 100.0 or 100f
Code:
IntValz1 EQU 100
quat     dd 0,0

mov     [quat+4],IntValz1   ;this ok
mov     [quat],IntValz1#.0  ;this fasm get error
mov     [quat],IntValz1\.0  ;this fasm get error
mov     [quat],IntValz1\f   ;this fasm get error
    


Last edited by Roman on 16 Jan 2021, 14:58; edited 1 time in total
Post 16 Jan 2021, 10:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 18170
Location: In your JS exploiting you and your system
revolution
The hash (#) only works inside macro blocks.
Code:
IntValz1 EQU 100
quat     dd 0,0

match v, IntValz1 {
  mov     [quat],v#.0
}    
Post 16 Jan 2021, 10:08
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1080
Roman
Quote:
match v, IntValz1 {
mov [quat],v#.0
}

Some times this is not handfull and very easy forgot this.

Why not exist more simple mechanism ?
Like this for example:
Code:
IntValz1 EQU 100
mov     [vals],IntValz1(f)
mov     [vals],IntValz1(.0)
;or this
vals dd IntValz1,IntValz1(f)
    
Post 16 Jan 2021, 10:21
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7918
Location: Kraków, Poland
Tomasz Grysztar
There is one in fasmg.
Post 16 Jan 2021, 13:52
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1080
Roman
Quote:
There is one in fasmg.

Why not in fasmw 1.73 ?
Post 16 Jan 2021, 15:21
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7918
Location: Kraków, Poland
Tomasz Grysztar
The module that handles floats in fasm 1 is very limited and not easily extendable, while in fasmg the architecture was designed from ground up with such abilities in mind.
Post 16 Jan 2021, 15:24
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1080
Roman
Very sad.
If create new method ?
Not EQU.
For example UVS

Undefined Value State.

Code:
data1 dd 0,0,0,0,0,0,0
MyVal UVS 100
mov [data1],MyVal#f
mov [data1],MyVal#.0

MyVal2 UVS 100,10,20,3
mov [data1],MyVal#f ;this unroll to four commands 
    
Post 16 Jan 2021, 17:01
View user's profile Send private message 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 GitHub, YouTube, Twitter.

Website powered by rwasa.