The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: qWord on July 24, 2011, 01:34:50 AM

Title: SmplMath
Post by: qWord on July 24, 2011, 01:34:50 AM
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 (http://sourceforge.net/projects/smplmath/)


regards, qWord
Title: Re: SmplMath
Post by: qWord on July 24, 2011, 06:40:44 PM
I've moved the project to sourceforge, where you can download the whole package: SmplMath (http://sourceforge.net/projects/smplmath/)

qWord