News:

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

translating a special structure in c++

Started by ToutEnMasm, July 09, 2009, 06:20:38 PM

Previous topic - Next topic

ToutEnMasm


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

typedef struct
{
  double real, imag;
} doublecomplex;

drizz

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 ---
The truth cannot be learned ... it can only be recognized.

mitchi

Drizz's solution gets mitchi's seal of approval.

dedndave

i am guessing that is how they represnt an imaginary real ?
i bet Japeth would approve as well - lol

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

dedndave

it's an imaginary real   :P
kinda like that time i went on a date with Charlize Theron - lol

ToutEnMasm

#6
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]

Astro

paradox struct
real REAL4 ?
imag REAL4 ?
paradox ends

doubleparadox struct
real REAL8 ?
imag REAL8 ?
doubleparadox ends

:lol

ToutEnMasm


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