The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ToutEnMasm on July 09, 2009, 06:20:38 PM

Title: translating a special structure in c++
Post by: ToutEnMasm on July 09, 2009, 06:20:38 PM

Did someone hnow how this can be translated in masm ?
Quote
typedef struct
{
  float real, imag;
} complex;

typedef struct
{
  double real, imag;
} doublecomplex;
Title: Re: translating a special structure in c++
Post by: drizz on July 09, 2009, 09:49:28 PM
h2incx , http://www.japheth.de/h2incX.html

you should try it some time.

;--- include file created by h2incx v0.99.14, copyright 2005 japheth
;--- source file: 1.h, last modified: 7/9/2009 23:55

complex struct
real REAL4 ?
imag REAL4 ?
complex ends

doublecomplex struct
real REAL8 ?
imag REAL8 ?
doublecomplex ends


;--- errors: 0
;--- end of file ---
Title: Re: translating a special structure in c++
Post by: mitchi on July 09, 2009, 10:21:21 PM
Drizz's solution gets mitchi's seal of approval.
Title: Re: translating a special structure in c++
Post by: dedndave on July 09, 2009, 10:24:40 PM
i am guessing that is how they represnt an imaginary real ?
i bet Japeth would approve as well - lol
(http://www.yellowandblack.com.au/forum/images/smilies/WeAreNotWorthy.gif)
Title: Re: translating a special structure in c++
Post by: Mark Jones on July 10, 2009, 12:30:55 AM
So is is real, or imaginary? :bg
Title: Re: translating a special structure in c++
Post by: dedndave on July 10, 2009, 12:53:18 AM
it's an imaginary real   :P
kinda like that time i went on a date with Charlize Theron - lol
Title: Re: translating a special structure in c++
Post by: ToutEnMasm on July 10, 2009, 06:03:42 AM
Thanks,
The good answer win a translation of 32 bits header files for the amd math lib,acml4.3.0.  :U
I don't know if it can be used with masm and how ?
Perhaps is there here someone to test it ?.
http://developer.amd.com/cpu/Libraries/acml/Pages/default.aspx

c Prototypes must work with masm,I have modify the zip

[attachment deleted by admin]
Title: Re: translating a special structure in c++
Post by: Astro on July 10, 2009, 04:07:03 PM
paradox struct
real REAL4 ?
imag REAL4 ?
paradox ends

doubleparadox struct
real REAL8 ?
imag REAL8 ?
doubleparadox ends

:lol
Title: Re: translating a special structure in c++
Post by: ToutEnMasm on July 10, 2009, 06:07:06 PM

Notes:  Prototypes are not standard (nothing say it in the file as in the sdk)
Quote
; 23   :   x[2] = compose_complex(1.0, 3.0);

   push   ecx    *
   fld   DWORD PTR __real@40400000
   fstp   DWORD PTR [esp]
   push   ecx    *
   fld1
   fstp   DWORD PTR [esp]
   call   _compose_complex
*******   add   esp, 8  **********************
   mov   DWORD PTR _x$[ebp+16], eax
   mov   DWORD PTR _x$[ebp+20], edx