flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > About 'fbld'

Author
Thread Post new topic Reply to topic
BiDark



Joined: 22 Jun 2003
Posts: 110
Location: .th
BiDark
Hello Tomasz,

I can't do 80 bits decimal

Code:
  fbld  [here]

here dt 4

error: 'invalid value'
    


fbld need m80 bits decimal (currently accepts only floating point?).
Post 06 May 2004, 11:40
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7577
Location: Kraków, Poland
Tomasz Grysztar
Yes, only floating point is allowed for "dt" (see docs), fasm integer expression calculator works on 64-bit values. You have to compose such value from smaller pieces, something like:
Code:
label here tword
dq 1234567876543210h
dw 0000h ; four highest decimal digits    

Also some nice macro would be done...
Post 06 May 2004, 11:54
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7577
Location: Kraków, Poland
Tomasz Grysztar
Here's a sample macro:
Code:
macro BCD name,value
{
  label name tword
  virtual at 0
   times 20 db '0'
   db `value
   qval = 0
   wval = 0
   repeat 16
    load a byte from $-%
    qval = qval + (a-'0') shl ((%-1)*4)
   end repeat
   repeat 4
    load a byte from $-16-%
    wval = wval + (a-'0') shl ((%-1)*4)
   end repeat
  end virtual
  dq qval
  dw wval
}

BCD here,12345678999999977773    
Post 06 May 2004, 12:04
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 110
Location: .th
BiDark
Really wish an 'build-in' support (Masm has dt and real10 for this).
You'r really fast. Thanks!
Post 06 May 2004, 12:15
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.

Powered by rwasa.