News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Complex Numbers in 64 bits

Started by HSE, August 15, 2022, 09:08:32 AM

Previous topic - Next topic

HSE

Hi all!!

I maked a translation of  Complex Number Zlib Library by Raymond Filiatreault to neutral bitness.

For 32 bit I used ML, but JWASM family must work.

For 64 bit I used UASM64 or JWASM15. To use ML64, !ZERO? must be replaced with ~ZERO?, because I can't make that with macros  :biggrin: (if somebody know magic, that could be interesting).

ML64 can be used with prebuilded library. I added masm64rt.inc I'm using, and a macros64(G).inc with a little more complete INVOKE macro that could be necessary.

Regards, HSE.

Update: 1. Zlib.zip (109.48 kB - downloaded 8 times.)
            2.  I was forgetting a little thing in ZNeg function. Zlib2.zip (114.92 kB - 1 times.)
            3.  Making ecx disappear in 64 bits.
Equations in Assembly: SmplMath

Biterider

Hi HSE
Cool work.  :thumbsup:
I will check the files ASAIC. Would it be an option to use the jnz/jz mnemonics directly?

Biterider

HSE

Hi Biterider

Quote from: Biterider on August 15, 2022, 03:36:53 PM
Cool work.

Very automatic  :biggrin:. I think just one line in one function is relevant for calculation, all others modifications are loading or saving numbers (always the same).

Quote from: Biterider on August 15, 2022, 03:36:53 PM
Would it be an option to use the jnz/jz mnemonics directly?

Yes. But more easy is to use UASM64 or JWASM15  :biggrin:

Vasily macros can't see any negation. In ML64, single symbol "!" apparently is processed by the parser and never reach macros.

HSE
Equations in Assembly: SmplMath

HSE

Hi all!

Magical trick on ecx in 64 bits is critical, but I don't saw that using only FPU  :biggrin:

Corrected in first post.

Regards, HSE
Equations in Assembly: SmplMath

Biterider

Hi HSE
Do you mean this one?
      mov   __ecx,uID
      and   __ecx,Z_SINGLE or Z_DBL   ;check uID for operand size
      .if   ZERO?
            mov   __ecx,10
            jmp   @F
      .elseif __ecx == 4
            jmp   @F
      .elseif __ecx == 8
            jmp   @F
      .endif


Biterider

HSE

Hi Biterider!

Exactly.  :biggrin: :biggrin:

And:ZAcos proc public USES _ecx lpSrc1:XWORD, lpDest:XWORD, uID:DWORD

They are ecx/r10d and ecx/r10 in this case, for DWORD and POINTER in 32/64 bits.

Raymond preserved the volatile register in callee function. I make that very often.

HSE
Equations in Assembly: SmplMath

HSE

Hi all!

A 64 bits version of Raymond's Ztest is added in first post. This app build with ML64 (to compensate that 64 bit library is builded with UASM64  :biggrin:).

I failed to translate FpuFLtoA and FpuAtoFL then, in the lazzy way, replace that by fptoa and vc_sscanf :biggrin:

Regards, HSE.
Equations in Assembly: SmplMath