News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

FP constants

Started by rags, September 23, 2005, 02:44:27 PM

Previous topic - Next topic

rags

I decided to try to lean a little about fpu math, and started to read Raymonds tutorial on the fpu.

what I didn't see and I am having problems with, is declaring a FP constant in the .data section.

For example:
  when I try this:


.data
var1 dq .3048


  I get this:
    error a2006
   undefined symbol: 3048

How would I declare a fp constant, without having it as a string first such as:


.data
var1 db ".3048",0


and convert it to an integer using the FPULib function FpuAtoFl ?
God made Man, but the monkey applied the glue -DEVO

dsouza123

.data
var1  real8   0.3048
var2  real10 1.2342

real8 is floating point equivalent of qword, dq  (eight bytes)
real10 is floating point equivalent of tbyte, dt  (ten bytes)

rags

God made Man, but the monkey applied the glue -DEVO

raymond

rags

You can always use dd for a REAL4, dq for a REAL8, and dt for a REAL10. However, the MASM assembler NEEDS both an integer portion (even if it's 0), a decimal point, AND at least one decimal digit (again even if it's 0) in order to convert the declared value as a float.

(I don't know how other assemblers deal with the syntax of those declarations.)

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com