News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Arbitrary Precision with MPFR

Started by aw27, August 02, 2017, 01:47:38 AM

Previous topic - Next topic

aw27

I have updated the LIBs to MPFR 3.1.5 (it took a few hours  :(, believe it or not).
And updated the ASM examples for both static and dynamic linking (dynamic has not been done before) and for x86 and x64.
Unfortunately, I can not include the LIBS and DLLs in the attachment because there is a limit of 512KB, so you will have to download them from the URL supplied in the source inside the attachment.

habran

That is nice work, well presented :t
Thank you for demonstrating the ability of UASM 8)

you could have used instead of:

    mov ebx, 1
.while ebx<=100
INVOKE mpfr_mul_ui, addr t, addr t, ebx, MPFR_RNDU
INVOKE mpfr_set_d, addr u, REAL8ONE, MPFR_RNDD
INVOKE mpfr_div, addr u, addr u, addr t, MPFR_RNDD
INVOKE mpfr_add, addr s, addr s, addr u, MPFR_RNDD
inc ebx
.endw
 
this:

    .for (ebx=1:ebx<=100:ebx++)
INVOKE mpfr_mul_ui, addr t, addr t, ebx, MPFR_RNDU
INVOKE mpfr_set_d, addr u, REAL8ONE, MPFR_RNDD
INVOKE mpfr_div, addr u, addr u, addr t, MPFR_RNDD
INVOKE mpfr_add, addr s, addr s, addr u, MPFR_RNDD
    .endfor

I am here not trying to be smart ass but showing ability of UASM :icon_cool:
There is nothing wrong with your choice :biggrin:
Cod-Father

aw27

Quote
.for (ebx=1:ebx<=100:ebx++)

Nice suggestion habran. :t

Quote
Topic moved: Arbitrary Precision with MPFR

I agree, all source code that does not assemble directly with the amazing Microsoft Macro Assemblers must be dispatched to specialized subforums.  :eusa_clap:


hutch--

Its done for a sensible reason, the code you posted will not build with any version of MASM so I moved it to where it is properly supported with an assembler that will build it.

jj2007

Quote from: hutch-- on August 09, 2017, 01:23:56 AM
Its done for a sensible reason, the code you posted will not build with any version of MASM so I moved it to where it is properly supported with an assembler that will build it.

Reasonable decision. Fortunately, MasmBasic builds with Masm :P

Jokes apart, for builds fine but:for_s:
   .for (ebx=1:ebx<=100:ebx++)
    nop
   .endfor
for_endp:

while_s:
   mov ebx, 1
   .While ebx<=100
nop
inc ebx
  .Endw
while_endp:

whileOpt_s:
   xor ebx, ebx
   .While ebx<=100
inc ebx
nop
  .Endw
whileOpt_endp:

repeat_s:
   xor ebx, ebx
   .Repeat
nop
inc ebx
  .Until ebx>100
repeat_endp:


14      bytes for for
14      bytes for while
11      bytes for whileOpt
9       bytes for repeat

aw27

Quote from: jj2007 on August 09, 2017, 01:31:23 AM
Reasonable decision. Fortunately, MasmBasic builds with Masm :P

MASM, or any assembler for the case, can deal with undocumented libraries written in any language. This does not mean that the whole has anything to do with Assembly Language.
I don't know how many people you have convinced it has, after all these years.  :badgrin: