News:

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

SmplMath

Started by qWord, July 24, 2011, 01:34:50 AM

Previous topic - Next topic

qWord

hi all,

In the following I want to share some macros, which I have developed and used over last years. They allow to evaluate mathematically expression as known from HLLs (c/c++,...). Currently the macros produce FPU code for calculations. They should work with all MASMs versions and the latest release of jWasm.  Also they are compatible with the MASM32-SDK.

Here a short example to give you an idea of the macros:
Quote; console application
include masm32rt.inc
.686p
.mmx
.xmm
include \macros\smplmath\math.inc
.code
main proc
LOCAL x:REAL8,y:REAL4
LOCAL fSlvTLS()

    fpuSetPrecision ,REAL8

    ldl x=3.5
   
    fSlv y = x*(1+2*3^4) + sqrt(x)
   
    invoke crt_printf,chr$("%f",13,10),@fSlv8( x*(1+2*3^4) + sqrt(x) )

    .if fGT(x,123.E-4) || fLT(x,123)
        ; what ever
    .endif
   
    inkey
    exit
main endp
end main

The SmplMath package currently consist of the needed includes, examples and a documentation (PDF).
Maybe some of you find these macros also useful   :bg

The download link: SmplMath


regards, qWord
FPU in a trice: SmplMath
It's that simple!

qWord

I've moved the project to sourceforge, where you can download the whole package: SmplMath

qWord
FPU in a trice: SmplMath
It's that simple!