News:

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

Main Menu

Calc macros

Started by ragdog, April 18, 2014, 01:55:02 AM

Previous topic - Next topic

ragdog

Hello all

Gives any simply calculationĀ“s macros for Masm what i can use in a call like cpp?

example +,-,*,/

testproc( pstruct->item, pstruct->item1 - pstruct->item0 - 1 );

regards,

jj2007

Sure:
include \masm32\MasmBasic\MasmBasic.inc      ; download
      Init
      mov eax, 100
      mov ecx, 1000
      fldpi
      Inkey Str$("10*PI=%f", ecx/eax*ST(0))
      Exit
end start


10*PI=31.41593

But wait for qWord, he can explain what SmplMath is all about ;-)

ragdog

Hi Jochen

I have look in simplemath and i can understand it works this with Fpu?!?

I wish only with sub,add,Imul,Idiv and eax,ebx.....

After compile it with cpp
"testproc( pstruct->item, pstruct->item1 - pstruct->item0 - 1 );"

is this only

mov     edx, [eax+385h]
mov     eax, [eax+389h]
dec     ecx
push    ecx
sub     eax, edx
push    edx
call   testproc

And this same Macros for Masm32 is wonderful :biggrin: